Link to home
Start Free TrialLog in
Avatar of Tier4 Services
Tier4 Services

asked on

Ansible, pushing configuration to cisco device

Hello,

We are trying to push a configuration to a Cisco router using ansible.
when we run a playbook we a re getting the following output:
ansible-playbook site.yml -i inventory

PLAY [Generate Router Configuration Files] *****************************************************************************************************************************

TASK [router : Generate configuration files] ***************************************************************************************************************************
failed: [x.x.x.x]  "msg": "Failed to connect to the host via ssh: Permission denied (publickey,keyboard-interactive,password).\r\n", "unreachable": true}
fatal: [x.x.x.x]: UNREACHABLE! => {"changed": false, "msg": "All items completed", "results": [{"_ansible_ignore_errors": null, "_ansible_item_result": true, "item": {}


PLAY RECAP *************************************************************************************************************************************************************
x.x.x.x               : ok=0    changed=0    unreachable=1    failed=0






Also: if I specificity the username to execute the playbook I got the following:

ansible-playbook site.yml -i inventory -u myuser

PLAY [Generate Router Configuration Files] *****************************************************************************************************************************

TASK [router : Generate configuration files] ***************************************************************************************************************************
 [WARNING]: sftp transfer mechanism failed on [x.x.x.x]. Use ANSIBLE_DEBUG=1 to see detailed information

 [WARNING]: scp transfer mechanism failed on [x.x.x.x]. Use ANSIBLE_DEBUG=1 to see detailed information

fatal: [x.x.x.x]: FAILED! => {"msg": "Failed to get information on remote file (/etc/ansible/TEMPLATES/myfolder/CONFIGS/RouterA.cfg): Shared connection to x.x.x.x closed.\r\n"}
        to retry, use: --limit @/etc/ansible/TEMPLATES/myfolder/site.retry

PLAY RECAP *************************************************************************************************************************************************************
x.x.x.x               : ok=0    changed=0    unreachable=0    failed=1


don't know why the connection is being refused.
we are new with ansible so I appreciate any suggestion.
Avatar of Kyle Santos
Kyle Santos
Flag of United States of America image

Hi,

I am here to help you with your open question.  Do you still need help?  I have the ability to alert more experts if you still need help.

If you solved the problem on your own, would you please post the solution here in case others have the same problem?

If you need me to delete this question just say "Delete."

Thank you for using Experts Exchange.

Regards,

Kyle Santos
Customer Relations
This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.