Try to fix sshd

This commit is contained in:
Bertrand Benjamin 2018-08-24 11:14:48 +02:00
parent cbd457eb13
commit 41c1a87e25
1 changed files with 6 additions and 1 deletions

View File

@ -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