Add templating of network interfaces

Closes #1
This commit is contained in:
2019-07-04 11:19:24 -04:00
parent 9b9234eeb1
commit a9b2942027
5 changed files with 137 additions and 35 deletions

View File

@ -0,0 +1,13 @@
# PVC node interface-specific interface file - {{ network.key }}
# {{ ansible_managed }}
auto {{ network.value['device'] }}
iface {{ network.value['device'] }} inet manual
post-up ip link set $IFACE mtu {{ network.value['mtu'] }}
{% if network.value['type'] == 'bond' %}
bond_mode {{ network.value['bond_mode'] }}
slaves {% for device in network.value['bond_devices'] %}{{ device }} {% endfor %}
{% endif %}
{% if network.value['type'] == 'vlan' %}
vlan_raw_device {{ network.value['raw_device'] }}
{% endif %}