Try to fix sshd
This commit is contained in:
parent
cbd457eb13
commit
41c1a87e25
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user