--- - name: Configure sshd for password auth ansible.builtin.lineinfile: path: "/etc/ssh/sshd_config" regex: "^(#)?{{ item.key }}" line: "{{ item.key }} {{ item.value }}" state: present loop: - {key: "PasswordAuthentication", value: "yes"} notify: Restart sshd