mirror of
https://pagure.io/fedora-infra/ansible.git
synced 2026-05-12 19:06:39 +08:00
This should only affect stg hosts. We had set all of iad2 the same, prod and stg both. We need to make sure stg resolves to stg hosts first. This worked somewhat until now because we replace the resolv.conf on stg hosts, but without this they are borken right after boot and until we replace the resolv.conf and restart httpd or other services. Signed-off-by: Kevin Fenzi <kevin@scrye.com>
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 == '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 %}
|