Ansible VM and GNS3 routers

26 views
Skip to first unread message

jesty sam

unread,
Feb 7, 2020, 12:16:50 PM2/7/20
to Ansible Project
Hi 

I have two VM's in Azure, 1 VM running Ansible and the other having GNS3 (with connected routers and switches). I am able to telnet from Ansible server to the Routers configured in GNS3 however when i run a playbook i get an error

PLAY [gather information from routers] *********************************************************************************************************************************

TASK [gather router facts] *********************************************************************************************************************************************
fatal: [10.0.0.21]: FAILED! => {"changed": false, "msg": "[Errno None] Unable to connect to port 5007 on 10.0.0.21"}

PLAY RECAP *************************************************************************************************************************************************************
10.0.0.21                  : ok=0    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0

---
- name: gather information from routers
  hosts: ios
  gather_facts: no

  tasks:
    - name: gather router facts
      ios_facts:

Below is the hosts file entry

[ios]

[ios:vars]
ansible_network_os=ios
#ansible_port=5007
ansible_connection=network_cli
ansible_python_interpreter=/usr/bin/env python


what could be wrong?

jesty sam

unread,
Feb 9, 2020, 9:33:29 PM2/9/20
to Ansible Project
Any suggestions?

Nilashish Chakraborty

unread,
Feb 9, 2020, 11:36:13 PM2/9/20
to Ansible Project
Hello,

Are you able to manually SSH into the GNS3 Routers from the Ansible controller on the specified port? I see you are using `ansible_connection=network_cli`. This connection plugin provides a connection to remote devices over SSH and implements a CLI shell.
Reply all
Reply to author
Forward
0 new messages