facts: only look up prefixes and VLANs once
Also drop "access-*" hosts from setup playbook as they have all been renamed to "sw-*".
This commit is contained in:
parent
4ca177ff04
commit
48eee50203
2 changed files with 19 additions and 16 deletions
|
@ -1,5 +1,8 @@
|
||||||
# Make expensive lookups to NetBox once for later reference by any host.
|
# Make expensive lookups to NetBox once for later reference by any host.
|
||||||
|
- delegate_to: localhost
|
||||||
|
block:
|
||||||
- name: Lookup networks and prefixes
|
- name: Lookup networks and prefixes
|
||||||
|
run_once: true
|
||||||
set_fact:
|
set_fact:
|
||||||
vlans: '{{ query("netbox.netbox.nb_lookup", "vlans", api_filter="group=new-net", raw_data=true)
|
vlans: '{{ query("netbox.netbox.nb_lookup", "vlans", api_filter="group=new-net", raw_data=true)
|
||||||
| sort(attribute="vid") }}'
|
| sort(attribute="vid") }}'
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
- exit
|
- exit
|
||||||
|
|
||||||
# Set up access switches.
|
# Set up access switches.
|
||||||
- hosts: access-*, sw-*
|
- hosts: sw-*
|
||||||
gather_facts: false
|
gather_facts: false
|
||||||
roles:
|
roles:
|
||||||
- access
|
- access
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue