mirror of
https://pagure.io/fedora-infra/ansible.git
synced 2026-03-20 03:57:02 +08:00
55 lines
1.7 KiB
Django/Jinja
55 lines
1.7 KiB
Django/Jinja
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 == 'rdu3' and env == 'production' %}
|
|
DOMAIN="rdu3.fedoraproject.org vpn.fedoraproject.org fedoraproject.org"
|
|
{% elif hostvars[inventory_hostname].datacenter == 'rdu3' and env == 'staging' %}
|
|
DOMAIN="stg.rdu3.fedoraproject.org rdu3.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 %}
|