ntc-ansible | Multi-vendor network modules
kandi X-RAY | ntc-ansible Summary
kandi X-RAY | ntc-ansible Summary
Multi-vendor network modules
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Parse raw output
- Parse CLI output
- Convert a cli table to a list of dictionaries
- Try to connect to a device
- Parse NTC response
- Check if the system is already set
- Validate data against a schema
- Check for error params
ntc-ansible Key Features
ntc-ansible Examples and Code Snippets
Community Discussions
Trending Discussions on ntc-ansible
QUESTION
I am using the networktocode ntc-ansible module in Ansible to control Cisco IOS devices (switches currently). I successfully can use ntc_show_Command to get 'show version' and 'show ip int brief' and put the result into a local file. But when I use the -vvv at the end of the ansible-playbook command, I see structured JSON output in the terminal. How do I get a access the "module_args" and the "response" from the ntc_show_command, ie. if i use "show ip int brief" and i want to know the status of int gi1/0/5. How can I access that? And then... what playbook commands would/could I use to grab the specific data I am looking for?
Here is the output I can see when I run the playbook, with -vvv, but I don't know how to access the structured data
...ANSWER
Answered 2018-Jul-25 at 23:23You need to register the output and then start using debug and set_fact to retrieve the data structure elements that you want to retrieve:
Here I register the output and then only retrieve the 'FastEthernet4' interface.
QUESTION
I am trying to using the ntc-ansible
module with Ansible running on Ubuntu (WSL). I have ssh connectivity to my remote device (Cisco 2960X) and I can run ansible playbooks to the same remote switch using the built in Ansible networking modules (ios_command
) and it works fine.
Issue:
When I try to run any of the ntc-ansible modules, it fails, unable to connect to the device. Probably something simple, but I have hit a wall. There is something I am missing about how to use ntc-ansible modules. Ansible is seeing the modules as I can look at the docs as was suggested as a test in the readme.
I have ntc-ansible module installed here: /home/melshman/.ansible/plugins/modules/ntc-ansible I am running my playbooks from here: ~/projects/ansible/ The first time I ran the playbook with the ntc-ansible modules it failed and based on error message and some research I installed sshpass (sudo apt-get install sshpass). But still having ssh problems using ntc-ansible… (playbook and traceback below)
I hear folks taking about an index file, but I can’t find that file? Where does it live and what do I need to do with it?
What is my connection supposed to be setup to be? Local? SSH? Netmiko_ssh?
What should I be using for platform? Cisco_ios? cisco_ios_ssh?
Appreciate any help I can get. I have been running in circles for hours and hours.
Ansible Version Info:
...ANSWER
Answered 2018-Jul-20 at 18:42Here is a working solution using ntc_show_command to a Cisco IOS device.
QUESTION
I want to run an Ansible playbook on multiple hosts and register outputs to a variable. Now using this variable, I want to copy output to single file. The issue is that in the end there is output of only one host in the file. How can I add output of all the hosts in a file one after the other. I don't want to use serial = 1
as it slows down execution considerably if we have multiple hosts.
ANSWER
Answered 2017-Sep-18 at 06:15result
variable will be registered as a fact on each host the task ntc_show_command
was run, thus you should access the value through hostvars
dictionary.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install ntc-ansible
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page