ntc_get_facts¶
Synopsis¶
Added in version 1.9.2
Reboot a network device, optionally on a timer. Supported platforms include Cisco Nexus switches with NX-API, Cisco IOS switches or routers, Arista switches with eAPI.
Options¶
| parameter | required | default | choices | comments |
|---|---|---|---|---|
| host | no |
Hostame or IP address of switch. |
||
| ntc_conf_file | no |
The path to a local NTC configuration file. If omitted, and ntc_host is specified, the system will look for a file given by the path in the environment variable PYNTC_CONF, and then in the users home directory for a file called .ntc.conf. |
||
| ntc_host | no |
The name of a host as specified in an NTC configuration file. |
||
| password | no |
Password used to login to the target device |
||
| platform | no |
|
Switch platform |
|
| port | no |
TCP/UDP port to connect to target device. If omitted standard port numbers will be used. 80 for HTTP; 443 for HTTPS; 22 for SSH. |
||
| secret | no |
Enable secret for devices connecting over SSH. |
||
| transport | no |
|
Transport protocol for API-based devices. |
|
| username | no |
Username used to login to the target device |
Important
Requires pyntc
Examples¶
- ntc_get_facts:
platform: cisco_nxos_nxapi
host: "{{ inventory_hostname }}"
username: "{{ username }}"
password: "{{ password }}"
transport: http
- ntc_get_facts:
ntc_host: n9k1
ntc_conf_file: .ntc.conf
- ntc_get_facts:
ntc_host: eos_leaf
- ntc_get_facts:
platform: arista_eos_eapi
host: "{{ inventory_hostname }}"
username: "{{ username }}"
password: "{{ password }}"
- ntc_get_facts:
platform: cisco_ios
host: "{{ inventory_hostname }}"
username: "{{ username }}"
password: "{{ password }}"
secret: "{{ secret }}"
Return Values¶
Common return values are documented here common_return_values, the following are the fields unique to this module:
| name | despcription | returned | type | sample |
|---|---|---|---|---|
| uptime | The device uptime represented as an integer number of strings. | success | int | 1313 |
| vendor | Vendor of network device. | success | string | cisco |
| uptime_string | The device uptime represented as a string format DD:HH:MM:SS. | success | string | 00:00:21:53 |
| interfaces | List of interfaces. | success | list | ['mgmt0', 'Ethernet1/1', 'Ethernet1/2', 'Ethernet1/3', 'Ethernet1/4', 'Ethernet1/5', 'Ethernet1/6'] |
| hostname | Hostname of network device. | success | string | N9K1 |
| fqdn | Fully-qualified domain name. | success | string | N9K1.ntc.com |
| os_version | Operating System version on network device. | success | string | 7.0(3)I2(1) |
| serial_number | Serial number on network device. | success | string | SAL1819S6LU |
| model | Hardware model of network device. | success | string | Nexus9000 C9396PX Chassis |
| vlans | List of VLAN IDs. | success | List | ['1', '2', '3', '4'] |
Note
Facts to be returned include - uptime (string), uptime (seconds), model, vendor, os_version, serial_number, hostname, fqdn, vlans, interfaces.
Note
Facts are automatically added to Ansible facts environment. No need to register them.