Hi,
I feel a little bit uncomfortable posting this, as it seems it should be a simple fix, but I cannot seem to find an answer.
Ive just installed Ansible 2.8.5 into a Vagrant VM on my laptop and from that I can gcloud compute ssh into my VMs, centos 7 and RedHat Enterprise 7, in Google Cloud fine and I can use the Linux ssh command into both servers. So the certificates are fine and ssh is working.
However when I try ansible ... -m ping, I’ve * out the actual IP, I get the following:
... | UNREACHABLE! => {
“changed”: false,
“msg”: “Failed to connect to the host via ssh: OpenSSH_7.6p1 Ubuntu-4ubuntu0.3, OpenSSL 1.0.2n 7 Dec 2017\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 19: Applying options for \r\ndebug1: auto-mux: Trying existing master\r\ndebug1: Control socket "/home/vagrant/.ansible/cp/6c6506f41a" does not exist\r\ndebug2: resolving "..." port 22\r\ndebug2: ssh_connect_direct: needpriv 0\r\ndebug1: Connecting to ...* [...] port 22.\r\ndebug2: fd 3 setting O_NONBLOCK\r\ndebug1: connect to address ... port 22: Connection timed out\r\nssh: connect to host ... port 22: Connection timed out”,
“unreachable”: true
}
however when I run
ansible ... -m ping -c paramiko
it works:
[WARNING]: Platform linux on host ... is using the discovered Python interpreter at
/usr/bin/python, but future installation of another Python interpreter could change this. See
https://docs.ansible.com/ansible/2.8/reference_appendices/interpreter_discovery.html for more
information.
... | SUCCESS => {
“ansible_facts”: {
“discovered_interpreter_python”: “/usr/bin/python”
},
“changed”: false,
“ping”: “pong”
}
Any ideas as to why is this happening?
Thank you for your help.
Note:
When I uploaded the id_rsa key to the servers I had to amend the file and change the user name for it to work. Not sure if this is a factor to what is happening here.