Allow NM-controlled DNS if intended

Signed-off-by: Patrick Uiterwijk <puiterwijk@redhat.com>
This commit is contained in:
Patrick Uiterwijk 2017-08-21 20:58:50 +00:00
parent 86cd6f5b0e
commit d12cedc5d3
3 changed files with 7 additions and 1 deletions

View file

@ -265,3 +265,6 @@ nagios_Check_Services:
# Set variable if we want to use our global iptables defaults
# Some things need to set their own.
baseiptables: True
# Most of our machines have manual resolv.conf files
nm_controlled_resolv: False

View file

@ -24,6 +24,7 @@
# XXX fixme # a datacenter 'fact' from setup
- name: /etc/resolv.conf
copy: src={{ item }} dest=/etc/resolv.conf
when: not nm_controlled_resolv
with_first_found:
- "{{ resolvconf }}"
- resolv.conf/{{ inventory_hostname }}
@ -53,7 +54,7 @@
ini_file: dest=/etc/NetworkManager/NetworkManager.conf section=main option=dns value=none
notify:
- restart NetworkManager
when: ansible_distribution_major_version|int >=7 and nmclitest|success and ( not ansible_ifcfg_blacklist)
when: ansible_distribution_major_version|int >=7 and nmclitest|success and ( not ansible_ifcfg_blacklist) and not nm_controlled_resolv
tags:
- config
- resolvconf
@ -124,6 +125,7 @@
- name: make sure our resolv.conf is the one being used - set RESOLV_MODS=no in /etc/sysconfig/network
lineinfile: dest=/etc/sysconfig/network create=yes backup=yes state=present line='RESOLV_MODS=no' regexp=^RESOLV_MODS=
when: not nm_controlled_resolv
tags:
- config
- base

View file

@ -29,3 +29,4 @@ IPV6_DEFAULTDEV={{item}}
IPV6_DEFAULTGW={{ hostvars[inventory_hostname][item + '_ipv6_gw'] }}
IPV6_MTU=1280
{% endif %}
DOMAIN="phx2.fedoraproject.org vpn.fedoraproject.org fedoraproject.org"