When setting deb repositories it is necessary to manually refresh, if there were some changes made since the metadata from mirrors don't get pulled in automatically “on change”. Therefore do the refresh “on change” manually. Signed-off-by: Matej Focko <me@mfocko.xyz>
19 lines
491 B
YAML
19 lines
491 B
YAML
---
|
|
- name: Add HashiCorp repository
|
|
ansible.builtin.deb822_repository:
|
|
name: hashicorp
|
|
types: deb
|
|
uris: https://apt.releases.hashicorp.com
|
|
suites: "{{ ansible_distribution_release }}"
|
|
components:
|
|
- main
|
|
signed_by: https://apt.releases.hashicorp.com/gpg
|
|
state: present
|
|
become: true
|
|
register: _deb_repo
|
|
|
|
- name: Refresh the cache if HashiCorp repo has been changed
|
|
ansible.builtin.apt:
|
|
update_cache: true
|
|
become: true
|
|
when: _deb_repo.changed
|