cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
7695
Views
6
Helpful
4
Replies

paramiko: The authenticity of host '[ios-xe-mgmt-latest.cisco.com]:8181


PLAY [sandbox-iosxe-latest] *********************************************************************************************************************************

TASK [facts] ************************************************************************************************************************************************
fatal: [sandbox-iosxe-latest]: FAILED! => {"changed": false, "msg": "paramiko: The authenticity of host '[ios-xe-mgmt-latest.cisco.com]:8181' can't be established.\nThe ssh-rsa key fingerprint is b7e974a8cbf96d464f7be3e12a86d265."}

PLAY RECAP **************************************************************************************************************************************************
sandbox-iosxe-latest : ok=0 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0

 

i am getting the above error

4 Replies 4

Claudia de Luna
Spotlight
Spotlight

Hi @rajeshchamanthula 

Have you successfully established an ssh connection to the sandbox device outside of Ansible?

 

Sergiu.Daniluk
VIP Alumni
VIP Alumni

Hi @rajeshchamanthula 

The Ansible is not printing the full message there. The full message is something like this:

The authenticity of host '<HOSTNAME IP>' can't be established.
RSA key fingerprint is XX:XX:XX:XX........XX:XX .
Are you sure you want to continue connecting (yes/no)?

This is an expected message when you first try to ssh to a device. It simply says this device has this IP and this fingerprint. Are you sure you want to connect to it?

As @Claudia de Luna mentioned, try first an SSH to ios-xe-mgmt-latest.cisco.com using a local SSH client, on the same machine where you run your Ansible playbooks. You will be asked if you are sure you want to continue. Type yes and then continue with your Ansible.

 

Cheers,

Sergiu

omz
VIP Alumni
VIP Alumni

for test environment .. 

you add following in ansible.cfg:

[defaults]
host_key_checking = False

If you don't want to modify ansible.cfg you can set an environment variable:

export ANSIBLE_HOST_KEY_CHECKING=False

 hope this helps 

maaro
Level 1
Level 1

Hi,

I was stuck in similar problem. I did not want to disable the host key checking and instead added the following to ansible.cfg and the problem got solved:

INI entry:

[paramiko_connection]
host_key_auto_add = True

Environment variable: ANSIBLE_PARAMIKO_HOST_KEY_AUTO_ADD=True 

And yes I tried to manually ssh to the device and accept the hostkey but it did not work in our environment till I added the above config.
/M