Can't connect to remote host

30 views
Skip to first unread message

Rusty Roy

unread,
Jul 1, 2017, 7:57:22 AM7/1/17
to Ansible Project
I can connect to the remote host via ssh, but ansible fails to connect. I'm loading the key using ssh.

If I run:
ansible vm-to-deploy-to -m ping -e "ansible_ssh_port=15674" -e "ansible_ssh_user=djeyewater"

Result is:
192.168.127.28 | UNREACHABLE! => {
    "changed": false,
    "msg": "Authentication or permission failure. In some cases, you may have been able to authenticate and did not have permissions on the remote directory. Consider changing the remote temp path in ansible.cfg to a path rooted in \"/tmp\". Failed command was: ( umask 77 && mkdir -p \"` echo /tmp/provision/ansible-tmp-1498908230.64-195102459534727 `\" && echo ansible-tmp-1498908230.64-195102459534727=\"` echo /tmp/provision/ansible-tmp-1498908230.64-195102459534727 `\" ), exited with result 1",
    "unreachable": true
}

But if I connect manually:
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 ConnectTimeout=10 -o ControlPath=/home/vagrant/.ansible/cp/ansible-ssh-%h-%p-%r djeye...@192.168.127.28 -p 15674

 and run that failed command, all is OK:
$ umask 77 && mkdir -p \"` echo /tmp/provision/ansible-tmp-1498908230.64-195102459534727 `\" && echo ansible-tmp-1498908230.64-195102459534727=\"` echo /tmp/provision/ansible-tmp-1498908230.64-195102459534727 `\"
ansible-tmp-1498908230.64-195102459534727="/tmp/provision/ansible-tmp-1498908230.64-195102459534727"
$ echo $?
0


So not sure what's going wrong when I try to connect using ansible?

Rusty Roy

unread,
Jul 2, 2017, 11:47:35 AM7/2/17
to Ansible Project
Don't know what the problem was, but restarting both local and remote machines seems to have fixed it.
Reply all
Reply to author
Forward
0 new messages