Comments (9)
@XioNoX Which version of napalm are you using here (not Ansible module, but napalm itself)?
from napalm-ansible.
$ pip show napalm
[...]
Version: 0.51.0
from napalm-ansible.
Are you using a virtual environment to run ansible?
from napalm-ansible.
Not that I'm aware of.
from napalm-ansible.
@XioNoX This works for me when I run it:
$ ansible-playbook napalm_ios.yml -i ./ansible-hosts --module-path ~/napalm-ansible/data_gathering/
PLAY [Test NAPALM on IOS] *****************************************************
GATHERING FACTS ***************************************************************
ok: [pynet-rtr1]
TASK: [Get facts] *************************************************************
ok: [pynet-rtr1]
PLAY RECAP ********************************************************************
pynet-rtr1 : ok=2 changed=0 unreachable=0 failed=0
Can you post your playbook and relevant section of ansible hosts (scrubbed of any confidential info)?
Also what version of Netmiko are you using?
$ python
Python 2.7.10 (default, Dec 8 2015, 18:25:23)
[GCC 4.8.3 20140911 (Red Hat 4.8.3-9)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import netmiko
>>> netmiko.__version__
'0.3.0'
from napalm-ansible.
$ python
Python 2.7.10 (default, Oct 14 2015, 16:09:02)
[GCC 5.2.1 20151010] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import netmiko
>>> netmiko.__version__
'0.3.0'
$ ls roles/napalm/library/
napalm_get_facts napalm_install_config
---
- name: Cisco facts
hosts: all
connection: local
gather_facts: no
roles:
- napalm
vars_prompt:
- name: "user_password"
prompt: "Device password"
private: yes
tasks:
- name: Checking SSH connectivity
tags: push
wait_for: host={{ inventory_hostname }} port=22 timeout=5
- name: Get Cisco Facts
napalm_get_facts:
hostname={{ inventory_hostname }}
username=xionox
dev_os=ios
password={{ user_password }}
register: cisco
- name: print all facts
debug: msg="{{ cisco.ansible_facts }}"
ansible-playbook -i networking-devices-cisco cisco_facts.yml --limit myhost -vvvv
Loaded callback default of type stdout, v2.0
1 plays in cisco_facts.yml
Device password:PLAY [Cisco facts] *************************************************************
TASK [Checking SSH connectivity] ***********************************************
task path: /network-automation/cisco_facts.yml:13
ESTABLISH LOCAL CONNECTION FOR USER: xionox
myhost EXEC ( umask 22 && mkdir -p "$( echo$HOME/.ansible/tmp/ansible-tmp-1455904969.47-166918409601240 )" && echo "$ ( echo $HOME/.ansible/tmp/ansible-tmp-1455904969.47-166918409601240 )" )
myhost PUT /tmp/tmpoGfBh9 TO /home/xionox/.ansible/tmp/ansible-tmp-1455904969.47-166918409601240/wait_for
myhost EXEC LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 /usr/bin/python /home/xionox/.ansible/tmp/ansible-tmp-1455904969.47-166918409601240/wait_for; rm -rf "/home/xionox/.ansible/tmp/ansible-tmp-1455904969.47-166918409601240/" > /dev/null 2>&1
ok: [myhost] => {"changed": false, "elapsed": 0, "invocation": {"module_args": {"connect_timeout": 5, "delay": 0, "exclude_hosts": null, "host": "myhost", "path": null, "port": "22", "search_regex": null, "state": "started", "timeout": "5"}, "module_name": "wait_for"}, "path": null, "port": 22, "search_regex": null, "state": "started"}TASK [Get Cisco Facts] *********************************************************
task path: /network-automation/cisco_facts.yml:16
ESTABLISH LOCAL CONNECTION FOR USER: xionox
myhost EXEC ( umask 22 && mkdir -p "$( echo$HOME/.ansible/tmp/ansible-tmp-1455904969.7-141120962226216 )" && echo "$ ( echo $HOME/.ansible/tmp/ansible-tmp-1455904969.7-141120962226216 )" )
myhost PUT /tmp/tmpg2hEfA TO /home/xionox/.ansible/tmp/ansible-tmp-1455904969.7-141120962226216/napalm_get_facts
myhost EXEC LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 /usr/bin/env python /home/xionox/.ansible/tmp/ansible-tmp-1455904969.7-141120962226216/napalm_get_facts; rm -rf "/home/xionox/.ansible/tmp/ansible-tmp-1455904969.7-141120962226216/" > /dev/null 2>&1
Then it hangs there.
The fix (or workaround) from comment 0 fixes that.
from napalm-ansible.
@XioNoX Yes, I saw your fix, but that change shouldn't be necessary. I also wasn't able to reproduce your problem.
Can you reformat your playbook (YAML file) above. It got munched by the markdown.
from napalm-ansible.
Updated.
from napalm-ansible.
I'm not having this issue after pulling the latest version of napalm_get_facts.
from napalm-ansible.
Related Issues (20)
- napalm-ansible ignoring ProxyCommand HOT 2
- Ansible 2.10 breaks build
- napalm-ping was unreliable when testing it for IOS (does default delay_factor need increased)
- Create a napalm rollback module
- Create a commit + confirm module HOT 11
- Convert the tests over to GitHub Actions
- Review documentation and make sure it is updated properly for using the new napalm collection
- Remove old setup.py and other old non-collection code from this repository
- napalm Collection on AWX 19.0.0 HOT 9
- npalm_install_merge.yml does not revert all changes HOT 1
- napalm collection with ansible_network_os fully-qualified HOT 1
- Netmiko4 read_timeout default is too short for IOS commit_conifg operation HOT 29
- napalm_ping: Add source_interface argument
- napalm module : Error: "'ascii' codec can't encode characters in position 5396-5398: ordinal not in range(128)"} HOT 14
- napalm module : Error: "'ascii' codec can't encode characters in position 5396-5398: ordinal not in range(128)"}
- Research why napalm_get_nxos_ssh.yml was intermittently failing
- The server is busy processing another request. Please try again later HOT 3
- Question About Installation Instructions HOT 16
- AnsiballZ_napalm_install_config.py Error HOT 6
- Error when deploying valid BGP VRF Address family config to a Cisco 9300 switch HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from napalm-ansible.