Ansible roles
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
801 B

# {{ ansible_managed }}
ANSIBLE=yes
NAME={{ item.name }}
DEVICE={{ item.name }}
BOOTPROTO={{ (item.ip4.enabled == True and item.ip4.method == 'dhcp') | ternary('dhcp', 'none') }}
ONBOOT=yes
{% if item.bridge is defined and item.type != 'bridge' %}
BRIDGE={{ item.bridge }}
{% endif %}
{% if item.type == 'vlan' %}
TYPE=Vlan
VLAN=yes
{% if item.vlanid is defined %}
VLAN_ID={{ item.vlanid }}
{% endif %}
{% if item.vlandev is defined %}
PHYSDEV={{ item.vlandev }}
{% endif %}
{% elif item.type == 'bridge' %}
TYPE=Bridge
STP=off
{% endif %}
{% if item.ip4.enabled == True and item.ip4.method != 'dhcp' %}
{% for addr in item.ip4.addr | default([]) %}
IPADDR{{ ansible_loop.index0 }}={{ addr.split('/')[0] }}
PREFIX{{ ansible_loop.index0 }}={{ addr.split('/')[1] }}
{% endfor %}
{% endif %}
IPV6INIT=no