diff --git a/tasks/ssh.yml b/tasks/ssh.yml index f69fe01..56a80fe 100644 --- a/tasks/ssh.yml +++ b/tasks/ssh.yml @@ -16,10 +16,15 @@ regexp: "^#?PermitRootLogin" line: "PermitRootLogin no" +- name: debug + debug: + msg: "{{ deploy_public_key }}" + - name: Add public key for deploy user authorized_key: user: "{{ item.username }}" key: "{{ lookup('file', deploy_public_key) }}" + state: present with_items: "{{ deploy_users }}" register: add_identity_key @@ -28,7 +33,7 @@ dest: /etc/ssh/sshd_config regexp: "^#?PasswordAuthentication" line: "PasswordAuthentication no" - when: add_identity_key|success and not add_identity_key|skipped + when: add_identity_key is success and not add_identity_key is skipped notify: restart sshd - name: Enable SSH daemon