Files
Ansible-roles/common/tasks/ssh.yml
T
2022-10-17 12:59:33 +02:00

13 lines
298 B
YAML

- name: Disable SSH password auth
lineinfile:
dest: /etc/ssh/sshd_config
regexp: '^PasswordAuthentication\s*yes'
line: "PasswordAuthentication no"
register: sshd_config
- name: Restart SSH daemon
service:
name: sshd
state: restarted
when: sshd_config.changed