diff --git a/ansible-scylla-node/tasks/Debian.yml b/ansible-scylla-node/tasks/Debian.yml index 8cec5bb2..e13c0e86 100644 --- a/ansible-scylla-node/tasks/Debian.yml +++ b/ansible-scylla-node/tasks/Debian.yml @@ -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 }}"