From cc54e326bbac8777c6a5e5714843cc0ecc7b5665 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?victor=20h=C3=A9ry?= Date: Sun, 11 Feb 2018 08:43:59 +0100 Subject: [PATCH] ssh-keys: remove old keys after adding new keys to avoid connection problem :') --- roles/ssh-keys/tasks/main.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) 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