Commit graph

5 commits

Author SHA1 Message Date
6ade4f2f8a access: fix VLAN database idempotency
Do not try and match the global VLAN list as printed by the switch.
Instead, only try to realize the truth: there may be some VLANs added
and some removed.

We keep the compact_numlist filter and use it instead of the built-in
vlan_parser when listing VLANs for tagged ports. This is because some
switches compact 1,2,4,5,6 as 1-2,4-6 and others as 1,2,4-6 (see next
commit).

All of this should reduce the number of cases where Ansible reports a
change in configuration where there was in fact no change.
2025-09-18 13:54:39 +02:00
4ca177ff04 access: set IPv6 management address for FS switches 2025-08-01 13:34:38 +02:00
8fd6f3bff6 access: fix check/diff mode for FS switches
Regardless of terminal width FS switches always split known VLAN
ranges into multiple lines of at most twenty numbers when showing
configuration. Do the same in our config template to avoid reporting
changes when there are none.

Allowed VLANs for tagged ports are displayed similarly but even worse,
with the first line specifying `allowed vlan only` for the first twenty
numbers and subsequent lines adding the remaining VLANs.

Not sure if configuring a switch this way – as opposed to a single long
`allowed vlan only` line – could disrupt traffic. Instead we simply
allow all VLANs on uplink ports, marked in NetBox as 'tagged-all'. For
downlink tagged ports the number of allowed VLANs is unlikely to
exceed twenty.

Ansible now reports no fictional changes for all existing access
switches. The only remaining issue is removing known VLANs, which has
to be done manually on each switch.
2025-08-01 12:20:08 +02:00
0ed4973894 access: get mgmt gateway from custom field on prefix
Mainly so we can drop the gateway custom field from NetBox interfaces.
2025-03-24 18:13:55 +01:00
c479f90669 access: move switch config templates back to this repo
Let’s keep it simple. Also editing templates in NetBox is a pain.
2024-04-08 14:45:39 +02:00