I'm trying to change the password using playbook but not getting the permission to do so.
I'm running the command:
ansible-playbook playbook.yml -k
- hosts: servers
remote_user: root
vars:
password: $1$Izd9zEZS$T11sNBK3bQgbzWkBMZq.
tasks:
- name: Changing Passwords
user:
name=root
password={{password}}
fatal: [host1]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: Permission denied (publickey).", "unreachable": true}
-vvvv
) should provide more info about which step is failing. – Halis