From c8d7a972b5746b8626dd0768013cd48f99b76c06 Mon Sep 17 00:00:00 2001 From: Raoul Scarazzini Date: Wed, 20 Mar 2024 15:06:51 +0100 Subject: [PATCH] Make Terraform url a variable This commit introduces the terraform_binary_url that will contain the full URL for the binary download. --- defaults/main.yml | 2 ++ tasks/install.yml | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 4e2f44f..3908224 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -4,6 +4,8 @@ terraform_binary_install: true terraform_binary_version: '0.14.2' terraform_binary_platform: 'linux_amd64' +terraform_binary_url: "https://releases.hashicorp.com/terraform/{{ terraform_binary_version }}/\ + terraform_{{ terraform_binary_version }}_{{ terraform_binary_platform }}.zip" # Where to deploy terraform resource files terraform_config_dir: 'terraform' diff --git a/tasks/install.yml b/tasks/install.yml index f9ec3e4..840ca89 100644 --- a/tasks/install.yml +++ b/tasks/install.yml @@ -23,8 +23,7 @@ - name: Download and extract terraform binary ansible.builtin.unarchive: - src: "https://releases.hashicorp.com/terraform/{{ terraform_binary_version }}/\ - terraform_{{ terraform_binary_version }}_{{ terraform_binary_platform }}.zip" + src: "{{ terraform_binary_url }}" dest: "{{ terraform_config_dir }}/bin" remote_src: true when: