RSA key save Error Resolution in Ansible


If you are also struggling while running ansible-plabook for new hosts and getting error like following, then you have two options. Either connect to each host one by one to save the RSA keys of that host to your ansible server or you can disable host key checking in ansible configuration file. Here is the way to do it

Edit/create either of the following files

 /etc/ansible/ansible.cfg or ~/.ansible.cfg

and add the following to the file.

[defaults]
host_key_checking = False

Error Message before disabling host key checking

fatal: [ios-xe-02]: FAILED! => {"ansible_facts": {"discovered_interpreter_python": "/usr/libexec/platform-python"}, "changed": false, "msg": "paramiko: The authenticity of host '[ios-xe-02]:8181' can't be established.\nThe ssh-rsa key fingerprint is b'b7e974a8cbf96d464f7be3e12a86d265'."}



Comments

Popular posts from this blog

Specifying SSH port in Ansible Inventory

Ansible-Playbook to display output of multiple show commands (using stdout_lines with Loop)

Filtering Routes in BGP using Route-maps and Prefix-list

Ansible Playbook for Network OS Upgrade with pre and post checks

Bypassing Proxy Server in Google Chrome

VMware NSX Traffic Flow — East-West & North-South

Export or Backup Azure Network Security Groups into CSV using PowerShell

Ansible-playbook for backing up running config of Cisco IOS