summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick Uiterwijk <puiterwijk@redhat.com>2017-08-21 21:01:08 +0000
committerPatrick Uiterwijk <puiterwijk@redhat.com>2017-08-21 21:01:08 +0000
commitdae3290dd71e2e8dea3ac63a40a6fbfaa6e1919f (patch)
treeb78b876dc95894ab7c633632dd993970a567dd82
parentd12cedc5d3c0927b42afae6698819af33ebe1287 (diff)
downloadansible-dae3290dd71e2e8dea3ac63a40a6fbfaa6e1919f.tar.gz
ansible-dae3290dd71e2e8dea3ac63a40a6fbfaa6e1919f.tar.xz
ansible-dae3290dd71e2e8dea3ac63a40a6fbfaa6e1919f.zip
Add dns1 and dns2 for nm-controlled resolv.conf
Signed-off-by: Patrick Uiterwijk <puiterwijk@redhat.com>
-rw-r--r--inventory/group_vars/all3
-rw-r--r--roles/base/templates/ifcfg.j24
2 files changed, 6 insertions, 1 deletions
diff --git a/inventory/group_vars/all b/inventory/group_vars/all
index 877a1ea56..182a0d5d9 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 55f7ac83a..22102185d 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"