diff --git a/inventory/group_vars/all b/inventory/group_vars/all index 6d84dc62b1..4d6560e4bd 100644 --- a/inventory/group_vars/all +++ b/inventory/group_vars/all @@ -55,6 +55,13 @@ mem_size: 2048 num_cpus: 2 lvm_size: 20000 +# on MOST infra systems, the interface connected to the infra network +# is eth0. but not on quite ALL systems. e.g. on s390 boxes it's enc900, +# on openqa-ppc64le-01.qa it's eth2 for some reason, and on qa01.qa and +# qa02.qa it's em3. currently this only affects whether GATEWAY, DOMAIN +# and DNS1/DNS2 lines are put into ifcfg-(device). +ansible_ifcfg_infra_net_devices: [ 'eth0', 'enc900' ] + # Default netmask. Almost all our phx2 nets are /24's with the # exception of 10.5.124.128/25. Almost all of our non phx2 sites are # less than a /24. diff --git a/inventory/host_vars/openqa-ppc64le-01.qa.fedoraproject.org b/inventory/host_vars/openqa-ppc64le-01.qa.fedoraproject.org index bf3ce9d2db..1b545a4b07 100644 --- a/inventory/host_vars/openqa-ppc64le-01.qa.fedoraproject.org +++ b/inventory/host_vars/openqa-ppc64le-01.qa.fedoraproject.org @@ -1,5 +1,7 @@ --- freezes: false +# the if connected to the infra network on this box is eth2, not eth0 +ansible_ifcfg_infra_net_devices: [ 'eth2' ] gw: 10.5.131.254 dns: 10.5.126.21 eth2_ip: 10.5.131.73 diff --git a/inventory/host_vars/qa01.qa.fedoraproject.org b/inventory/host_vars/qa01.qa.fedoraproject.org index b9c991227d..856ad71e58 100644 --- a/inventory/host_vars/qa01.qa.fedoraproject.org +++ b/inventory/host_vars/qa01.qa.fedoraproject.org @@ -5,6 +5,9 @@ sudoers: "{{ private }}/files/sudo/qavirt-sudoers" nrpe_procs_warn: 1400 nrpe_procs_crit: 1600 + +# the if connected to the infra network on this box is em3, not eth0 +ansible_ifcfg_infra_net_devices: [ 'em3' ] em3_ip: 10.5.124.151 em3_nm: 255.255.255.0 gw: 10.5.124.254 diff --git a/inventory/host_vars/qa02.qa.fedoraproject.org b/inventory/host_vars/qa02.qa.fedoraproject.org index 9cc5b4fa0a..9122800412 100644 --- a/inventory/host_vars/qa02.qa.fedoraproject.org +++ b/inventory/host_vars/qa02.qa.fedoraproject.org @@ -5,6 +5,9 @@ sudoers: "{{ private }}/files/sudo/qavirt-sudoers" nrpe_procs_warn: 1400 nrpe_procs_crit: 1600 + +# the if connected to the infra network on this box is em3, not eth0 +ansible_ifcfg_infra_net_devices: [ 'em3' ] em3_ip: 10.5.124.152 em3_nm: 255.255.255.0 gw: 10.5.124.254 diff --git a/roles/base/templates/ifcfg.j2 b/roles/base/templates/ifcfg.j2 index 9656c35e4d..2f334be67b 100644 --- a/roles/base/templates/ifcfg.j2 +++ b/roles/base/templates/ifcfg.j2 @@ -6,7 +6,7 @@ SUBCHANNELS="0.0.0900,0.0.0901,0.0.0902" NETTYPE="qeth" OPTIONS="layer2=1 portno=0" {% endif %} -{% if item == "eth0" or item == "enc900" %} +{% if item in ansible_ifcfg_infra_net_devices %} GATEWAY="{{gw}}" DOMAIN="phx2.fedoraproject.org vpn.fedoraproject.org fedoraproject.org" DNS1="{{ dns1 }}"