From 4b976460a72b48237e60bff73f2efb159cac7f45 Mon Sep 17 00:00:00 2001 From: Albin Kerouanton Date: Mon, 17 Jan 2022 16:03:40 +0100 Subject: [PATCH] Add a param to customize apt distribution release --- README.md | 3 +++ defaults/main.yml | 1 + tasks/install_hashi_repo.yml | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index f93c6a6d..a0cf9d2a 100644 --- a/README.md +++ b/README.md @@ -118,6 +118,9 @@ The role defines variables in `defaults/main.yml`: When set, you can also define `vault_hashicorp_key_url` and `vault_hashicorp_apt_repository_url` to override the default URL of the GPG key loaded in apt keyring and the default URL of the apt repository used. +- You can also set `vault_hashicorp_apt_distribution_release` to override the default distribution + release used. By default this param takes `{{ ansible_distribution_release }}`. You can use it if + you are managing your own apt mirrors and use some custom distribution release names. - Default value: *false* ### `vault_install_remotely` diff --git a/defaults/main.yml b/defaults/main.yml index d7a1880f..af9554a6 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -29,6 +29,7 @@ vault_install_remotely: false vault_privileged_install: false vault_hashicorp_key_url: "https://apt.releases.hashicorp.com/gpg" vault_hashicorp_apt_repository_url: "https://apt.releases.hashicorp.com" +vault_hashicorp_apt_distribution_release: "{{ ansible_distribution_release }}" # Paths vault_bin_path: /usr/local/bin diff --git a/tasks/install_hashi_repo.yml b/tasks/install_hashi_repo.yml index 517ae49c..6ad12ebc 100644 --- a/tasks/install_hashi_repo.yml +++ b/tasks/install_hashi_repo.yml @@ -24,7 +24,7 @@ - name: Add HashiCorp apt Repo become: true apt_repository: - repo: "deb {{ vault_hashicorp_apt_repository_url }} {{ ansible_distribution_release }} main" + repo: "deb {{ vault_hashicorp_apt_repository_url }} {{ vault_hashicorp_apt_distribution_release }} main" state: present when: ansible_pkg_mgr == 'apt'