debian: get inventory data from netbox

Set standardized interface names (mgmt0… for L2 management interfaces
and lan0… for L3 data interfaces speaking BGP). ASN is stored as a
custom field in netbox but that might change.
This commit is contained in:
Timotej Lazar 2023-07-19 14:06:35 +02:00
parent 2330edf479
commit 63ab087645
7 changed files with 69 additions and 48 deletions

View file

@ -0,0 +1,3 @@
{% for iface in hostvars[inventory_hostname].interfaces | selectattr('name', 'match', '^(lan|mgmt)') %}
SUBSYSTEM=="net", ACTION=="add", ATTR{address}=="{{ iface.mac_address|lower }}", NAME="{{ iface.name }}"
{% endfor %}