From 41c1a87e254ebbe3bc694b5740c1670d29115c71 Mon Sep 17 00:00:00 2001 From: Bertrand Benjamin Date: Fri, 24 Aug 2018 11:14:48 +0200 Subject: [PATCH] Try to fix sshd --- tasks/ssh.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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