ssh error connection time out

25 views
Skip to first unread message

Vikram Ranabhatt

unread,
Dec 23, 2015, 9:51:31 AM12/23/15
to Ansible Project

I am using ansible 1.9.3


Manuall ssh to the machine some time work and some time not work.But regardless of manuall ssh login...i am getting this error.


PLAY [licproxy] ***********************************************************

 

GATHERING FACTS ***************************************************************

<10.32.1.40> ESTABLISH CONNECTION FOR USER: my-user

<10.32.1.40> REMOTE_MODULE setup

<10.32.1.40> EXEC ssh -C -tt -vvv -o StrictHostKeyChecking=no -o IdentityFile="/opt/apps/installer/tenant-dev29/ssh/admin-key-vmsdev29" -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=cloud-user -o ConnectTimeout=10 10.32.1.40 /bin/sh -c 'mkdir -p $HOME/.ansible/tmp/ansible-tmp-1450797442.33-90087292637238 && chmod a+rx $HOME/.ansible/tmp/ansible-tmp-1450797442.33-90087292637238 && echo $HOME/.ansible/tmp/ansible-tmp-1450797442.33-90087292637238'

EXEC previous known host file not found for 10.32.1.40

fatal: [10.32.1.40] => SSH Error: ssh: connect to host 10.32.1.40 port 22: Connection refused

    while connecting to 10.32.1.40:22

It is sometimes useful to re-run the command using -vvvv, which prints SSH debug output to help diagnose the issue.

 

TASK: [Install tinyproxy] *****************************************************

FATAL: no hosts matched or all hosts have already failed -- aborting




.yml file

---
- hosts: myproxy
user: cloud-user
sudo: yes
tasks:

- name: Install tinyproxy
apt: name=tinyproxy state=present update_cache=yes

- name: Install bind9
apt: name=bind9 state=present update_cache=yes force=yes


Cody McCoder

unread,
Jan 19, 2016, 4:02:34 PM1/19/16
to Ansible Project
I believe I know the generic answer to your question from reading other posts:
  ~/.ssh/known_hosts must exist on the target machine for the user you are ssh as (also make sure you have the correct perms on this file and the .ssh directory)

The part that I would like to understand is WHY this file is required. If the ssh to the machine was successful and strict host key checking is off then what benefit is the file? This file will never exist on my freshly imaged machines and I'd rather not have to add a hack to create it for ansible. Any way to turn this off?
Reply all
Reply to author
Forward
0 new messages