Hello Rocky Linux Forum.
I am learning Ansible, and so I ask this question very carefully. Please don’t box me
I have successfully installed Ansible on my system running on Rocky 9.2 via the commands:
sudo dnf install epel-release
Then installed Ansible:
sudo dnf -y install ansible
Then I placed my inventory file in the Ansibles global inventory file in the
/etc/ansible/hosts
But when I run the Ad-Hoc Ansible command:
ansible -i [my_inventory_file] [server_group] -m ping -u <user>
I get the following error:
$ ansible -i hosts.ini example -m ping -u jil
192.168.200.40 | UNREACHABLE! => {
"changed": false,
"msg": "Failed to connect to the host via ssh: jil@192.168.200.40: Permission denied (publickey,password).",
"unreachable": true
}
If I ssh to the same server using the same user and server IP address:
$ ssh jil@192.168.200.40
jil@192.168.200.40's password:
I can successfully log in to the server.
where am I making a mistake? PLease educate me.