01-15-2022 05:03 AM
Hi
I'm following "Introduction to Ansible for IOS XE" and hitting and issue with the always on XE sandbox.
The first task is to run "ansible-playbook ansible-02-ios-modules/02-ios_command_show.yaml"
When I run that I get a network error.
"invalid connection specified, expected connection=local, got network_cli"
It feels like a basic connectivity issue. It would appear the device is not listening on tcp/8181 when I try telnet.
It's listening on 22 and 443 and I can use ssh and run the associated show commands from standard cli so the reachability is there.
01-15-2022 05:31 AM
- FYI : https://github.com/CiscoDevNet/dne-dna-code/issues/80
M.
01-17-2022 01:07 AM
Hi
Thanks for the reply. I tried deactivating and that didn't work so I created the second venv but I still get python2.7 as the python module.
(venv) [developer@centos intro-ansible]$ deactivate
[developer@centos intro-ansible]$ python3 -m venv venv2
[developer@centos intro-ansible]$ source venv2/bin/activate
(venv2) [developer@centos intro-ansible]$ ansible --version
ansible 2.4.3.0
config file = /home/developer/code/dne-dna-code/intro-ansible/ansible.cfg
configured module search path = [u'/home/developer/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python2.7/site-packages/ansible
executable location = /bin/ansible
python version = 2.7.5 (default, Aug 4 2017, 00:39:18) [GCC 4.8.5 20150623 (Red Hat 4.8.5-16)]
(venv2) [developer@centos intro-ansible]$ ansible-playbook ansible-02-ios-modules/02-ios_command_show.yaml
PLAY [Sample IOS show version for Ansible 2.5] *********************************************************************************************
TASK [GATHERING FACTS] *********************************************************************************************************************
fatal: [ios-xe-mgmt.cisco.com]: FAILED! => {"changed": false, "msg": "invalid connection specified, expected connection=local, got network_cli"}
to retry, use: --limit @/home/developer/code/dne-dna-code/intro-ansible/ansible-02-ios-modules/02-ios_command_show.retry
PLAY RECAP *********************************************************************************************************************************
ios-xe-mgmt.cisco.com : ok=0 changed=0 unreachable=0 failed=1
(venv2) [developer@centos intro-ansible]$
Could it be the version of python that's the issue rather that the host not listening on 8181?
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide