From dae3290dd71e2e8dea3ac63a40a6fbfaa6e1919f Mon Sep 17 00:00:00 2001 From: Patrick Uiterwijk Date: Mon, 21 Aug 2017 21:01:08 +0000 Subject: [PATCH] Add dns1 and dns2 for nm-controlled resolv.conf Signed-off-by: Patrick Uiterwijk --- inventory/group_vars/all | 3 +++ roles/base/templates/ifcfg.j2 | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/inventory/group_vars/all b/inventory/group_vars/all index 877a1ea56b..182a0d5d90 100644 --- a/inventory/group_vars/all +++ b/inventory/group_vars/all @@ -267,4 +267,7 @@ nagios_Check_Services: baseiptables: True # Most of our machines have manual resolv.conf files +# These settings are for machines where NM is supposed to control resolv.conf. nm_controlled_resolv: False +dns1: "10.5.126.21" +dns2: "10.5.126.22" diff --git a/roles/base/templates/ifcfg.j2 b/roles/base/templates/ifcfg.j2 index 55f7ac83a8..22102185d7 100644 --- a/roles/base/templates/ifcfg.j2 +++ b/roles/base/templates/ifcfg.j2 @@ -8,6 +8,9 @@ OPTIONS="layer2=1 portno=0" {% endif %} {% if item == "eth0" or item == "enc900" %} GATEWAY="{{gw}}" +DOMAIN="phx2.fedoraproject.org vpn.fedoraproject.org fedoraproject.org" +DNS1="{{ dns1 }}" +DNS2="{{ dns2 }}" {% endif %} HWADDR="{{ hostvars[inventory_hostname]['ansible_' + item]['macaddress']|upper }}" IPADDR="{{ hostvars[inventory_hostname][item + '_ip'] }}" @@ -29,4 +32,3 @@ IPV6_DEFAULTDEV={{item}} IPV6_DEFAULTGW={{ hostvars[inventory_hostname][item + '_ipv6_gw'] }} IPV6_MTU=1280 {% endif %} -DOMAIN="phx2.fedoraproject.org vpn.fedoraproject.org fedoraproject.org"