From f73b4ce9ca244d4c7a8ec1a3012fa36ffc1c2ab4 Mon Sep 17 00:00:00 2001 From: Stephen Smoogen Date: Fri, 26 Jun 2020 17:59:29 -0400 Subject: [PATCH] some networks will have multiple gateways --- roles/base/templates/ifcfg.j2 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/roles/base/templates/ifcfg.j2 b/roles/base/templates/ifcfg.j2 index 807b0325fc..db94042bc1 100644 --- a/roles/base/templates/ifcfg.j2 +++ b/roles/base/templates/ifcfg.j2 @@ -8,8 +8,12 @@ OPTIONS="layer2=1 portno=0" {% endif %} {% if item in ansible_ifcfg_infra_net_devices %} DEFROUTE=yes +{% if hostvars[inventory_hostname][item +'_gw'] is defined %} +GATEWAY="{{ hostvars[inventory_hostname][item + '_gw'] }}" +{% else %} GATEWAY="{{ gw }}" {% endif %} +{% endif %} {% if hostvars[inventory_hostname].datacenter == 'iad2' %} DOMAIN="iad2.fedoraproject.org vpn.fedoraproject.org fedoraproject.org" {% else %}