ntc_config_command¶
Synopsis¶
This module write config data to devices that don’t have an API. The use case would be writing configuration based on output gleaned from ntc_show_command output.
Options¶
| parameter | required | default | choices | comments |
|---|---|---|---|---|
| commands | no |
Command to execute on target device |
||
| commands_file | yes |
Command to execute on target device |
||
| connection | no | ssh |
|
connect to device using netmiko or read from offline file for testing |
| host | no |
IP Address or hostname (resolvable by Ansible control host) |
||
| password | no |
Password used to login to the target device |
||
| platform | yes | ssh |
Platform FROM the index file |
|
| port | no | 22 |
SSH port to use to connect to the target device |
|
| secret | no |
Password used to enter a privileged mode on the target device |
||
| username | no |
Username used to login to the target device |
Important
Requires netmiko
Examples¶
# write vlan data
- ntc_config_command:
connection: ssh
platform: cisco_nxos
commands:
- vlan 10
- name vlan_10
- end
host: "{{ inventory_hostname }}"
username: "{{ username }}"
password: "{{ password }}"
secret: "{{ secret }}"
# write config from file
- ntc_config_command:
connection: ssh
platform: cisco_nxos
commands_file: "dynamically_created_config.txt"
host: "{{ inventory_hostname }}"
username: "{{ username }}"
password: "{{ password }}"
secret: "{{ secret }}"