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:
parent
2330edf479
commit
63ab087645
7 changed files with 69 additions and 48 deletions
3
templates/10-network.rules.j2
Normal file
3
templates/10-network.rules.j2
Normal 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 %}
|
Loading…
Add table
Add a link
Reference in a new issue