1 2 3 4 5 6 7 8 9
- name: Disable SSH password authentication ansible.builtin.lineinfile: dest: "/etc/ssh/sshd_config" regexp: "^PasswordAuthentication" line: "PasswordAuthentication no" state: "present" validate: "sshd -t -f %s" notify: - Restart sshd