servers/roles/proxmox/templates/interfaces.j2

23 lines
638 B
Django/Jinja

{% set my_cluster = query('netbox.netbox.nb_lookup', 'clusters', raw_data=true,
api_filter='name='~cluster) | first -%}
# bridges must be named vmbrN for proxmox to care
{% for vlan in my_cluster.custom_fields.vlans | default([], true) | sort(attribute='vid') %}
auto vmbr{{ vlan.vid }}
iface vmbr{{ vlan.vid }} inet manual
# {{ vlan.name }}
bridge-vlan-aware no
bridge-ports vni{{ vlan.vid }}
bridge-stp off
bridge-fd 0
auto vni{{ vlan.vid }}
iface vni{{ vlan.vid }} inet static
vxlan-id {{ vlan.vid }}
mstpctl-bpduguard yes
mstpctl-portbpdufilter yes
{% endfor %}
source /etc/network/interfaces.d/*