From 18f1320eb3953b4b26c084b72370b8b61d644662 Mon Sep 17 00:00:00 2001 From: Patrick Uiterwijk Date: Sat, 10 Feb 2018 21:12:24 +0000 Subject: [PATCH] Support secondary IP Signed-off-by: Patrick Uiterwijk --- inventory/host_vars/pagure-proxy01.fedoraproject.org | 1 + roles/base/templates/ifcfg.j2 | 3 +++ 2 files changed, 4 insertions(+) diff --git a/inventory/host_vars/pagure-proxy01.fedoraproject.org b/inventory/host_vars/pagure-proxy01.fedoraproject.org index eff949a00b..bff11f29ba 100644 --- a/inventory/host_vars/pagure-proxy01.fedoraproject.org +++ b/inventory/host_vars/pagure-proxy01.fedoraproject.org @@ -45,6 +45,7 @@ eth0_nm: 255.255.255.128 has_ipv6: yes eth0_ipv6: "2610:28:3090:3001:dead:beef:cafe:fe46" eth0_ipv6_gw: "2610:28:3090:3001::1" +eth0_secondary_ip: 152.19.134.147 sponsor: ibiblio datacenter: ibiblio diff --git a/roles/base/templates/ifcfg.j2 b/roles/base/templates/ifcfg.j2 index 966803bc56..9656c35e4d 100644 --- a/roles/base/templates/ifcfg.j2 +++ b/roles/base/templates/ifcfg.j2 @@ -36,3 +36,6 @@ 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'] }}" +{% endif %}