Skip to content

Commit

Permalink
ansible-scylla-node: Enforces the installation of each APT key set
Browse files Browse the repository at this point in the history
Before this patch, if a key with a specific ID already installed was updated (because it was expired, for example), the key won't be locally updated causing and APT failure.

This patch removes the key and install it, enforcing using the latest one available.

Fixes: #329

Signed-off-by: Eduardo Benzecri <[email protected]>
  • Loading branch information
ebenzecri committed Jan 24, 2024
1 parent 87303b2 commit 24c26c9
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions ansible-scylla-node/tasks/Debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,19 @@
update_cache: yes
when: install_type == 'online' and scylla_repo_keyserver is defined and scylla_repo_keys is defined and (scylla_repo_keys|length > 0)

- name: "Purge keyring '{{ scylla_repo_keyringfile }}'"
ansible.builtin.file:
path: "{{ scylla_repo_keyringfile }}"
state: absent
when: install_type == 'online' and scylla_repo_keyserver is defined and scylla_repo_keys is defined and (scylla_repo_keys|length > 0)

- name: Remove an apt key by id previously added
ansible.builtin.apt_key:
id: "{{ item }}"
state: absent
with_items: "{{ scylla_repo_keys }}"
when: install_type == 'online' and scylla_repo_keyserver is defined and scylla_repo_keys is defined and (scylla_repo_keys|length > 0)

- name: Add an apt key by id from a keyserver
apt_key:
keyserver: "{{ scylla_repo_keyserver }}"
Expand Down

0 comments on commit 24c26c9

Please sign in to comment.