33 lines
784 B
Django/Jinja
33 lines
784 B
Django/Jinja
# ANSIBLE MANAGED FILE - DO NOT EDIT
|
|
#
|
|
[Match]
|
|
Name={{ item.key }}
|
|
|
|
[Network]
|
|
DHCP={{ "Yes" if item.value.dhcp | default(false) else "No" }}
|
|
IPv6AcceptRA=No
|
|
{% if item.value.dns is defined %}
|
|
{% for server in item.value.dns %}
|
|
DNS={{ server }}
|
|
{% endfor %}
|
|
{% endif %}
|
|
{% if item.value.bond is defined %}
|
|
Bond={{ item.value.bond }}
|
|
{% endif %}
|
|
|
|
{% if item.value.dhcp | default(false) %}
|
|
Gateway={{ item.value.gateway | ansible.netcommon.ipaddr('address') }}
|
|
{% for address in item.value.addresses %}
|
|
Address={{ address | ansible.netcommon.ipaddr('host/prefix') }}
|
|
{% endfor %}
|
|
{% endif %}
|
|
|
|
|
|
{% for interface in skylab_networking.interfaces.keys() %}
|
|
{% if interface.startswith(item.key) and interface.partition('.')[2] | number %}
|
|
VLAN={{ interface }}
|
|
{% endif %}
|
|
{% endfor %}
|
|
|
|
# EOF
|