List of errors seen while working on Ansible and their solutions.
Error
"msg": "Failed to connect to the host via ssh: ssh: connect to host 172.17.0.9 port 22: No route to host",
Cause and solution
Ansible control machine is not able to reach the client. Make sure client hostname is resolved via –
- DNS server or
- /etc/hosts of Ansible control server or
- By /etc/ansible/hosts or your custom Ansible inventory file.
Also, network connectivity over port 22 from Ansible control machine to the client is working fine (test using telnet)
Error
"msg": "Failed to connect to the host via ssh: Permission denied (publickey,password).",
Cause and solution
Ansible control server is failed to authenticate the connection to the client.
- Make sure you are using proper Ansible user for which password-less SSH is configured.
- Test passwordless SSH to client from normal shell prompt and make sure its working fine.