- netmiko
- TestFSM
- terminal
Gets config data from devices that don't have an API
- Synopsis
- Options
- Examples
This module offers structured data for CLI enabled devices by using the TextFSM library for templating and netmiko for SSH connectivity
| Parameter | required | default | choices | comments |
|---|---|---|---|---|
| username | no | Username used to login to the target device | ||
| vendor | yes | ssh | Vendor FROM the index file | |
| device_type | no | ssh | netmiko device type | |
| template_dir | no | ntc_templates | path where TextFSM templates are stored. Default path is ntc with ntc in the same working dir as the playbook being run | |
| host | no | IP Address or hostname (resolvable by Ansible control host) | ||
| connection | no | ssh |
|
connect to device using netmiko or read from offline file for testing |
| command | yes | Command to execute on target device | ||
| file | no | If using connection=offline, this is the file (with path) of a file that contains raw text output, i.e. 'show command' and then the contents of the file will be rendered with the the TextFSM template | ||
| password | no | Password used to login to the target device | ||
| index_file | no | index | name of index file. file location must be relative to the template_dir |
# get vlan data
- ntc_show_command:
connection=ssh
vendor=cisco
device_type=cisco_nxos
command='show vlan'
host={{ inventory_hostname }}
username={{ username }}
password={{ password }}
Created by Network to Code, LLC For: 2015