Attempt to fix ansible so that it will set up gw correctly using syntax as is used in other parts

This commit is contained in:
Stephen Smoogen 2020-06-26 14:11:12 -04:00
parent 2045306090
commit bfa6013d80
18 changed files with 21 additions and 22 deletions

View file

@ -1,4 +1,4 @@
--- ---
eth0_ip: 10.3.170.121 eth0_ip: 10.3.170.121
gw: 10.3.170.254 eth0_ipv4_gw: 10.3.170.254
datacenter: iad2 datacenter: iad2

View file

@ -1,5 +1,5 @@
--- ---
eth0_ip: 10.3.169.31 eth0_ip: 10.3.169.31
eth0_gw: 10.3.169.254 eth0_ipv4_gw: 10.3.169.254
datacenter: iad2 datacenter: iad2

View file

@ -1,5 +1,5 @@
--- ---
eth0_ip: 10.3.169.32 eth0_ip: 10.3.169.32
eth0_gw: 10.3.169.254 eth0_ipv4_gw: 10.3.169.254
datacenter: iad2 datacenter: iad2

View file

@ -1,5 +1,5 @@
--- ---
eth0_ip: 10.3.169.33 eth0_ip: 10.3.169.33
gw: 10.3.169.254 eth0_ipv4_gw: 10.3.169.254
datacenter: iad2 datacenter: iad2

View file

@ -1,5 +1,5 @@
--- ---
eth0_ip: 10.3.169.34 eth0_ip: 10.3.169.34
gw: 10.3.169.254 eth0_ipv4_gw: 10.3.169.254
datacenter: iad2 datacenter: iad2

View file

@ -1,5 +1,5 @@
--- ---
eth0_ip: 10.3.169.35 eth0_ip: 10.3.169.35
gw: 10.3.169.254 eth0_ipv4_gw: 10.3.169.254
datacenter: iad2 datacenter: iad2

View file

@ -1,5 +1,5 @@
--- ---
eth0_ip: 10.3.169.36 eth0_ip: 10.3.169.36
gw: 10.3.169.254 eth0_ipv4_gw: 10.3.169.254
datacenter: iad2 datacenter: iad2

View file

@ -1,5 +1,5 @@
--- ---
eth0_ip: 10.3.169.37 eth0_ip: 10.3.169.37
gw: 10.3.169.254 eth0_ipv4_gw: 10.3.169.254
datacenter: iad2 datacenter: iad2

View file

@ -1,5 +1,5 @@
--- ---
eth0_ip: 10.3.169.38 eth0_ip: 10.3.169.38
gw: 10.3.169.254 eth0_ipv4_gw: 10.3.169.254
datacenter: iad2 datacenter: iad2

View file

@ -1,5 +1,5 @@
--- ---
eth0_ip: 10.3.169.39 eth0_ip: 10.3.169.39
gw: 10.3.169.254 eth0_ipv4_gw: 10.3.169.254
datacenter: iad2 datacenter: iad2

View file

@ -1,5 +1,5 @@
--- ---
eth0_ip: 10.3.169.40 eth0_ip: 10.3.169.40
gw: 10.3.169.254 eth0_ipv4_gw: 10.3.169.254
datacenter: iad2 datacenter: iad2

View file

@ -1,5 +1,5 @@
--- ---
eth0_ip: 10.3.169.41 eth0_ip: 10.3.169.41
gw: 10.3.169.254 eth0_ipv4_gw: 10.3.169.254
datacenter: iad2 datacenter: iad2

View file

@ -1,5 +1,5 @@
--- ---
eth0_ip: 10.3.169.42 eth0_ip: 10.3.169.42
gw: 10.3.169.254 eth0_ipv4_gw: 10.3.169.254
datacenter: iad2 datacenter: iad2

View file

@ -1,5 +1,5 @@
--- ---
eth0_ip: 10.3.169.43 eth0_ip: 10.3.169.43
gw: 10.3.169.254 eth0_ipv4_gw: 10.3.169.254
datacenter: iad2 datacenter: iad2

View file

@ -1,5 +1,5 @@
--- ---
eth0_ip: 10.3.169.44 eth0_ip: 10.3.169.44
gw: 10.3.169.254 eth0_ipv4_gw: 10.3.169.254
datacenter: iad2 datacenter: iad2

View file

@ -1,5 +1,5 @@
--- ---
eth0_ip: 10.3.169.45 eth0_ip: 10.3.169.45
gw: 10.3.169.254 eth0_ipv4_gw: 10.3.169.254
datacenter: iad2 datacenter: iad2

View file

@ -1,5 +1,5 @@
--- ---
eth0_ip: 10.3.169.46 eth0_ip: 10.3.169.46
gw: 10.3.169.254 eth0_ipv4_gw: 10.3.169.254
datacenter: iad2 datacenter: iad2

View file

@ -7,10 +7,10 @@ NETTYPE="qeth"
OPTIONS="layer2=1 portno=0" OPTIONS="layer2=1 portno=0"
{% endif %} {% endif %}
{% if item in ansible_ifcfg_infra_net_devices %} {% if item in ansible_ifcfg_infra_net_devices %}
GATEWAY="{{gw}}" DEFROUTE=yes
{% if hostvars[inventory_hostname].datacenter == 'phx2' %} GATEWAY="{{ hostvars[inventory_hostname][item + '_ipv4_gw'] }}"
DOMAIN="phx2.fedoraproject.org vpn.fedoraproject.org fedoraproject.org" {% endif %}
{% elif hostvars[inventory_hostname].datacenter == 'iad2' %} {% if hostvars[inventory_hostname].datacenter == 'iad2' %}
DOMAIN="iad2.fedoraproject.org vpn.fedoraproject.org fedoraproject.org" DOMAIN="iad2.fedoraproject.org vpn.fedoraproject.org fedoraproject.org"
{% else %} {% else %}
DOMAIN="vpn.fedoraproject.org fedoraproject.org" DOMAIN="vpn.fedoraproject.org fedoraproject.org"
@ -18,7 +18,6 @@ DOMAIN="vpn.fedoraproject.org fedoraproject.org"
# Should be dc set # Should be dc set
DNS1="{{ dns1 }}" DNS1="{{ dns1 }}"
DNS2="{{ dns2 }}" DNS2="{{ dns2 }}"
{% endif %}
HWADDR="{{ hostvars[inventory_hostname]['ansible_' + item]['macaddress']|upper }}" HWADDR="{{ hostvars[inventory_hostname]['ansible_' + item]['macaddress']|upper }}"
{% if item in ansible_ifcfg_disabled %} {% if item in ansible_ifcfg_disabled %}
ONBOOT="no" ONBOOT="no"