servers/templates/10-network.rules.j2
Timotej Lazar 63ab087645 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.
2023-07-20 13:24:51 +02:00

4 lines
222 B
Django/Jinja

{% 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 %}