I am attempting to run ansible-playbook on centos ansible server. However, I get the below failed result. SSH connection and Adhoc commands work fine. Can somebody please assist ?

[root@smartbox ansible]# ansible alltestnodes -m raw -a “sh vrf | i mgmt”
[DEPRECATION WARNING]: The TRANSFORM_INVALID_GROUP_CHARS settings is set to allow bad characters in group names by default, this will change, but still be
user configurable on deprecation. This feature will be removed in version 2.10. Deprecation warnings can be disabled by setting deprecation_warnings=False in
ansible.cfg.
[WARNING]: Invalid characters were found in group names but not replaced, use -vvvv to see details

ln-br1.ln.com | CHANGED | rc=0 >>
mgmt ipv4,ipv6 v4:no routing,
Shared connection to ln-br1.ln.com closed.

usc-br1.usc.edu | CHANGED | rc=0 >>
mgmt ipv4,ipv6 v4:no routing,
Shared connection to usc-br1.usc.edu closed.

[root@smartbox ansible]# ansible-playbook vrf_getter.yml
[DEPRECATION WARNING]: The TRANSFORM_INVALID_GROUP_CHARS settings is set to allow bad characters in group names by default, this will change, but still be
user configurable on deprecation. This feature will be removed in version 2.10. Deprecation warnings can be disabled by setting deprecation_warnings=False in
ansible.cfg.
[WARNING]: Invalid characters were found in group names but not replaced, use -vvvv to see details

PLAY [PLAY 1: Capture and store VRF config] *******************************************************************************************************************

TASK [Gathering Facts] ****************************************************************************************************************************************
[WARNING]: Ignoring timeout(10) for eos_facts

[WARNING]: Ignoring timeout(10) for eos_facts

fatal: [ln-br1.ln.com]: FAILED! => {“ansible_facts”: {}, “changed”: false, “failed_modules”: {“eos_facts”: {“ansible_facts”: {“discovered_interpreter_python”: “/usr/bin/python”}, “failed”: true, “invocation”: {“module_args”: {“auth_pass”: null, “authorize”: null, “gather_network_resources”: null, “gather_subset”: [“all”], “host”: null, “password”: null, “port”: null, “provider”: null, “ssh_keyfile”: null, “timeout”: null, “transport”: null, “use_ssl”: null, “username”: null, “validate_certs”: null}}, “msg”: “paramiko: The authenticity of host ‘ln-br1.ln.com’ can’t be established.\nThe ssh-rsa key fingerprint is 6c918908c1aab6d3af0edfaa7e3e574b.”}}, “msg”: “The following modules failed to execute: eos_facts\n”}
fatal: [usc-br1.usc.edu]: FAILED! => {“ansible_facts”: {}, “changed”: false, “failed_modules”: {“eos_facts”: {“ansible_facts”: {“discovered_interpreter_python”: “/usr/bin/python”}, “failed”: true, “invocation”: {“module_args”: {“auth_pass”: null, “authorize”: null, “gather_network_resources”: null, “gather_subset”: [“all”], “host”: null, “password”: null, “port”: null, “provider”: null, “ssh_keyfile”: null, “timeout”: null, “transport”: null, “use_ssl”: null, “username”: null, “validate_certs”: null}}, “msg”: “paramiko: The authenticity of host ‘usc-br1.usc.edu’ can’t be established.\nThe ssh-rsa key fingerprint is 78914e12cdb9107994641c98f2b939ed.”}}, “msg”: “The following modules failed to execute: eos_facts\n”}

PLAY RECAP ****************************************************************************************************************************************************
ln-br1.ln.com : ok=0 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0
usc-br1.usc.edu : ok=0 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0

[root@smartbox ansible]#

fyi, here’s the “vrf_getter.yml” playbook:

Hi!

This is a bit of “bootstrapping” that you need to do with Ansible.

You can either set the host_key_checking parameter to false in your ansible.cfg file or make sure log in to your network devices and accept the key prior to running your playbook.

# https://docs.ansible.com/ansible/2.4/intro_getting_started.html#host-key-checking
# False disables host key checking in your ssh known_hosts file <--Use with Caution!!!
host_key_checking=False

Here is a repo I use for training
https://github.com/cldeluna/cisco_ios

The ansible.cfg file is in there an annotated with settings that are useful if you are working with network devices (well…the settings that I find useful when working with network devices :D).

Claudia

Hi Claudio,

Thank you for your valuable feedback. The “host_key_checking=False” was commented out in my config file, I just uncommented it and it worked. . The other tweak I had to make was to run “aaa authorization exec default local” command on arista nodes to get privilege level authorization on arista nodes.

-Dhaval