From 305bd6af2f6c522aaa06b88c881e46b8b0ba2d60 Mon Sep 17 00:00:00 2001 From: Stephen Smoogen Date: Fri, 26 Jun 2020 18:12:31 -0400 Subject: [PATCH] fix the ipv4_gw issue --- roles/base/templates/ifcfg.j2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/base/templates/ifcfg.j2 b/roles/base/templates/ifcfg.j2 index db94042bc1..1382fef809 100644 --- a/roles/base/templates/ifcfg.j2 +++ b/roles/base/templates/ifcfg.j2 @@ -8,8 +8,8 @@ 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'] }}" +{% if hostvars[inventory_hostname][item +'ipv4_gw'] is defined %} +GATEWAY="{{ hostvars[inventory_hostname][item + 'ipv4_gw'] }}" {% else %} GATEWAY="{{ gw }}" {% endif %}