-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
54e91e0
commit b74edbe
Showing
1 changed file
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# Network Facts and Configs | ||
|
||
This role gathers native Ansible Facts or sets custom facts to parse command output and convert device configurations into code. Once gathered, facts can be used as backups/restores, called later as variables in other roles or playbooks, and used to define the state of a device. | ||
|
||
## Compatibility | ||
|
||
``` | ||
eos | ||
ios | ||
iosxr | ||
nxos | ||
aruba | ||
aireos | ||
f5-os | ||
fortimgr | ||
junos | ||
paloalto | ||
vyos | ||
``` | ||
|
||
-------------- | ||
|
||
## Role Variables | ||
|
||
Ansible uses the `ansible_network_os` inventory variable to define the device OS. This should ideally be coming from an inventory or group variable. | ||
|
||
### Ansible Network Fact Collection | ||
|
||
Ansible's native fact gathering can be invoked by setting `gather_facts: true` in your top level playbook. | ||
|
||
Additionally, every major networking vendor has fact modules that you can use in a playbook task: `ios_facts`, `eos_facts`, `nxos_facts`, `junos_facts`, etc... | ||
|
||
#### Examples | ||
|
||
Ansible fact collection: | ||
``` | ||
- name: collect device facts and running configs | ||
hosts: all | ||
gather_facts: yes | ||
connection: network_cli | ||
``` | ||
|
||
Fact Module: | ||
``` | ||
tasks: | ||
- name: gather ios facts | ||
ios_facts: | ||
gather_subset: all | ||
``` |