Try to fix sshd
This commit is contained in:
parent
cbd457eb13
commit
41c1a87e25
@ -16,10 +16,15 @@
|
|||||||
regexp: "^#?PermitRootLogin"
|
regexp: "^#?PermitRootLogin"
|
||||||
line: "PermitRootLogin no"
|
line: "PermitRootLogin no"
|
||||||
|
|
||||||
|
- name: debug
|
||||||
|
debug:
|
||||||
|
msg: "{{ deploy_public_key }}"
|
||||||
|
|
||||||
- name: Add public key for deploy user
|
- name: Add public key for deploy user
|
||||||
authorized_key:
|
authorized_key:
|
||||||
user: "{{ item.username }}"
|
user: "{{ item.username }}"
|
||||||
key: "{{ lookup('file', deploy_public_key) }}"
|
key: "{{ lookup('file', deploy_public_key) }}"
|
||||||
|
state: present
|
||||||
with_items: "{{ deploy_users }}"
|
with_items: "{{ deploy_users }}"
|
||||||
register: add_identity_key
|
register: add_identity_key
|
||||||
|
|
||||||
@ -28,7 +33,7 @@
|
|||||||
dest: /etc/ssh/sshd_config
|
dest: /etc/ssh/sshd_config
|
||||||
regexp: "^#?PasswordAuthentication"
|
regexp: "^#?PasswordAuthentication"
|
||||||
line: "PasswordAuthentication no"
|
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
|
notify: restart sshd
|
||||||
|
|
||||||
- name: Enable SSH daemon
|
- name: Enable SSH daemon
|
||||||
|
Loading…
Reference in New Issue
Block a user