diff --git a/roles/ssh-keys/tasks/main.yml b/roles/ssh-keys/tasks/main.yml index 04bb33c..316c316 100644 --- a/roles/ssh-keys/tasks/main.yml +++ b/roles/ssh-keys/tasks/main.yml @@ -16,19 +16,19 @@ state: installed when: ansible_distribution == 'CentOS' -- name: Remove old SSH keys +- name: Deploy SSH keys tags: ssh_keys authorized_key: user: root key: "{{ item.value }}" - state: absent - with_dict: "{{ admin_blacklist_ssh_keys }}" - when: admin_blacklist_ssh_keys is defined + state: present + with_dict: "{{ admin_ssh_keys }}" -- name: Deploy SSH keys +- name: Remove old SSH keys tags: ssh_keys authorized_key: user: root key: "{{ item.value }}" - state: present - with_dict: "{{ admin_ssh_keys }}" \ No newline at end of file + state: absent + with_dict: "{{ admin_blacklist_ssh_keys }}" + when: admin_blacklist_ssh_keys is defined \ No newline at end of file