Query prefixes once for all hosts

And group them into vrf_prefixes for VLAN networks and bgp_prefixes for
servers plugged directly into fabric.

This should reduce the number of queries to NetBox when configuring
firewalls and exit switches. Not sure but I think set_fact helps to
avoid queries (as opposed to setting group_vars).
This commit is contained in:
Timotej Lazar 2024-04-28 10:59:32 +02:00
parent 1c0709a6a6
commit 457ab7d3b7
10 changed files with 52 additions and 50 deletions

View file

@ -1,3 +1,8 @@
- hosts: '*'
roles:
- facts
# Set up fabric.
- hosts: spine-*
roles:
- spine
@ -10,11 +15,13 @@
roles:
- exit
# Set up access switches.
- hosts: access-*, sw-*
gather_facts: false
roles:
- access
# Set up firewall.
- hosts: fw-*
roles:
- firewall