From 285222783cb80881d0378181772e53ebbebeffce Mon Sep 17 00:00:00 2001 From: Maksim Bazhin Date: Tue, 13 Aug 2024 16:59:52 +0300 Subject: [PATCH] changed apt installation to deb822 for consul --- roles/consul/tasks/install_linux_repo.yml | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/roles/consul/tasks/install_linux_repo.yml b/roles/consul/tasks/install_linux_repo.yml index bc4fd8fc6..1b8798867 100644 --- a/roles/consul/tasks/install_linux_repo.yml +++ b/roles/consul/tasks/install_linux_repo.yml @@ -72,19 +72,18 @@ retries: 3 when: ansible_os_family == "Debian" - - name: Add an Apt signing key, uses whichever key is at the URL - ansible.builtin.apt_key: - url: "{{ consul_repo_url }}/gpg" + - name: Add hashicorp repository and an apt signing key, uses whichever key is at the URL + ansible.builtin.deb822_repository: + name: "{{ consul_repo_url.split('//')[1] | replace('.', '-') }}" + types: "deb" + uris: "{{ consul_repo_url }}" + signed_by: "{{ consul_repo_url }}/gpg" + suites: "{{ ansible_distribution_release }}" + components: "main" + enabled: true state: present when: "ansible_os_family|lower == 'debian'" - - name: Add hashicorp repository - ansible.builtin.apt_repository: - repo: "deb {{ consul_repo_url }} {{ ansible_distribution_release }} main" - state: present - update_cache: true - when: "ansible_os_family|lower == 'debian'" - - name: Update apt cache ansible.builtin.apt: update_cache: true