NAME="{{item}}"
BOOTPROTO="none"
NM_CONTROLLED=yes
{% if item == "enc900" %}
SUBCHANNELS="0.0.0900,0.0.0901,0.0.0902"
NETTYPE="qeth"
OPTIONS="layer2=1 portno=0"
{% endif %}
{% if item in ansible_ifcfg_infra_net_devices %}
DEFROUTE=yes
GATEWAY="{{ gw }}"
{% endif %}
{% if hostvars[inventory_hostname].datacenter == 'iad2' and env == 'production' %}
DOMAIN="iad2.fedoraproject.org vpn.fedoraproject.org fedoraproject.org"
{% elif hostvars[inventory_hostname].datacenter == 'iad2' and env == 'staging' %}
DOMAIN="stg.iad2.fedoraproject.org iad2.fedoraproject.org vpn.fedoraproject.org fedoraproject.org"
{% else %}
DOMAIN="vpn.fedoraproject.org fedoraproject.org"
{% endif %}
# Should be dc set
DNS1="{{ dns1 }}"
DNS2="{{ dns2 }}"
HWADDR="{{ hostvars[inventory_hostname]['ansible_' + item]['macaddress']|upper }}"
{% if item in ansible_ifcfg_disabled %}
ONBOOT="no"
{% else %}
IPADDR="{{ hostvars[inventory_hostname][item + '_ip'] }}"
NETMASK="{{ hostvars[inventory_hostname][item + '_nm'] }}"
{% if hostvars[inventory_hostname][item +'_off'] is defined %}
ONBOOT="no"
{% else %}
ONBOOT="yes"
{% endif %}
{% endif %}
TYPE="Ethernet"
DEVICE="{{item}}"
{% for line in if_uuid.stdout_lines %}
{% if line.split()[0] == item %}
UUID="{{ line.split()[1] }}"
{% endif %}
{% endfor %}
{% if has_ipv6 is defined %}
IPV6INIT=yes
IPV6ADDR_SECONDARIES="{{ hostvars[inventory_hostname][item + '_ipv6'] }}"
IPV6_ROUTER=no
IPV6_AUTOCONF=no
IPV6_DEFAULTDEV={{item}}
IPV6_DEFAULTGW={{ hostvars[inventory_hostname][item + '_ipv6_gw'] }}
IPV6_MTU=1280
{% endif %}
{% if hostvars[inventory_hostname][item + '_secondary_ip'] is defined %}
IPADDR1="{{ hostvars[inventory_hostname][item + '_secondary_ip'] }}"
PREFIX1=24
{% endif %}
