- netmiko
- TestFSM
- terminal
Gets config data from devices that don't have an API
This module offers structured data for CLI enabled devices by using the TextFSM library for templating and netmiko for SSH connectivity.
The platform
parameter given to the modules should be of the form:<netmiko_device_type>[-<hardware_type>]
.
In plain English, that means it should start with a supported netmiko
device type, followed by an optional hyphen
and arbitrary hardware specific identifier.
Valid platform
names:
cisco_ios-c3k
cisco_ios-c6k
cisco_ios
cisco_nxos
hp_comware
Invalid platform
names:
cisco-ios-c3k
csco_ios
hp-comware_5900
Parameter | required | default | choices | comments |
---|---|---|---|---|
username | no | Username used to login to the target device | ||
platform | yes | ssh | Platform FROM the index file | |
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
platform=cisco_nxos
command='show vlan'
host={{ inventory_hostname }}
username={{ username }}
password={{ password }}
Created by Network to Code, LLC For: 2015