dotfiles/roles/secrets_hcv/tasks/install_deb.yml
Matej Focko a763442128
fix(deb,repos): refresh after adding new repos
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>
2025-04-21 12:05:54 +02:00

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