Hi,
I am having a problem running the ansible -m ping command.
The error that I am getting is UNREACHABLE, but this is silly as plain ssh ubuntu@ec2-11-222-111-44.compute-1.amazonaws.com works.
When a add -c paramiko the ping commands also works.
I am using Mac OS X Sierra and ansible v2.1.2.0.
(I changed the hostnames below…)
What is going on and am I doing something wrong?
P
$ ansible -i ./inventory.clj all -m ping -vvvv
Loaded callback minimal of type stdout, v2.0
<ec2-11-222-111-44.compute-1.amazonaws.com> ESTABLISH SSH CONNECTION FOR USER: ubuntu
<ec2-11-222-111-44.compute-1.amazonaws.com> SSH: EXEC ssh -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=ubuntu -o ConnectTimeout=10 -o ControlPath=/Users/pieterbreed/.ansible/cp/ansible-ssh-%h-%p-%r ec2-11-222-111-44.compute-1.amazonaws.com ‘/bin/sh -c ‘"’"’( umask 77 && mkdir -p “echo $HOME/.ansible/tmp/ansible-tmp-1476098732.78-202601743171382
” && echo ansible-tmp-1476098732.78-202601743171382=“echo $HOME/.ansible/tmp/ansible-tmp-1476098732.78-202601743171382
” ) && sleep 0’“'”‘’
<ec2-22-111-222-32.compute-1.amazonaws.com> ESTABLISH SSH CONNECTION FOR USER: ubuntu
<ec2-22-111-222-32.compute-1.amazonaws.com> SSH: EXEC ssh -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=ubuntu -o ConnectTimeout=10 -o ControlPath=/Users/pieterbreed/.ansible/cp/ansible-ssh-%h-%p-%r ec2-22-111-222-32.compute-1.amazonaws.com ‘/bin/sh -c ‘"’"’( umask 77 && mkdir -p “echo $HOME/.ansible/tmp/ansible-tmp-1476098732.78-114535721843059
” && echo ansible-tmp-1476098732.78-114535721843059=“echo $HOME/.ansible/tmp/ansible-tmp-1476098732.78-114535721843059
” ) && sleep 0’“'”‘’
ec2-11-222-111-44.compute-1.amazonaws.com | UNREACHABLE! => {
“changed”: false,
“msg”: “Failed to connect to the host via ssh.”,
“unreachable”: true
}
ec2-22-111-222-32.compute-1.amazonaws.com | UNREACHABLE! => {
“changed”: false,
“msg”: “Failed to connect to the host via ssh.”,
“unreachable”: true
}
$ ansible -i ./inventory.clj all -m ping -c paramiko
ec2-11-222-111-44.compute-1.amazonaws.com | SUCCESS => {
“changed”: false,
“ping”: “pong”
}
ec2-22-111-222-32.compute-1.amazonaws.com | SUCCESS => {
“changed”: false,
“ping”: “pong”
}
$ ./inventory.clj | jq .
{
“worker-nodes”: {
“hosts”: [
“ec2-11-222-111-44.compute-1.amazonaws.com”
],
“children”: ,
“vars”: {}
},
“master-nodes”: {
“hosts”: [
“ec2-22-111-222-32.compute-1.amazonaws.com”
],
“children”: ,
“vars”: {}
},
“_meta”: {
“hostvars”: {
“ec2-22-111-222-32.compute-1.amazonaws.com”: {
“ansible_user”: “ubuntu”,
“ansible_host”: “ec2-22-111-222-32.compute-1.amazonaws.com”
},
“ec2-11-222-111-44.compute-1.amazonaws.com”: {
“ansible_user”: “ubuntu”,
“ansible_host”: “ec2-11-222-111-44.compute-1.amazonaws.com”
}
}
}
}