diff options
author | Devan Goodwin <dgoodwin@redhat.com> | 2016-07-04 10:10:04 -0300 |
---|---|---|
committer | Devan Goodwin <dgoodwin@redhat.com> | 2016-07-04 10:10:04 -0300 |
commit | 7f04025263b19ac07c27198f8c1e3358a6206fd5 (patch) | |
tree | 06e10770b216c6b2f85e047675e62d7ed93f2b3d /roles/openshift_node_dnsmasq | |
parent | 0071ab46bf9ae73bbb09c9fa0c9eb8a342a81ba1 (diff) | |
parent | 34f5de4185b0ae475367e9316a44bdf58fce1dc9 (diff) | |
download | openshift-7f04025263b19ac07c27198f8c1e3358a6206fd5.tar.gz openshift-7f04025263b19ac07c27198f8c1e3358a6206fd5.tar.bz2 openshift-7f04025263b19ac07c27198f8c1e3358a6206fd5.tar.xz openshift-7f04025263b19ac07c27198f8c1e3358a6206fd5.zip |
Merge branch 'master' into upgrade33
Diffstat (limited to 'roles/openshift_node_dnsmasq')
-rwxr-xr-x | roles/openshift_node_dnsmasq/files/networkmanager/99-origin-dns.sh | 7 | ||||
-rw-r--r-- | roles/openshift_node_dnsmasq/handlers/main.yml | 7 | ||||
-rw-r--r-- | roles/openshift_node_dnsmasq/tasks/main.yml | 11 |
3 files changed, 22 insertions, 3 deletions
diff --git a/roles/openshift_node_dnsmasq/files/networkmanager/99-origin-dns.sh b/roles/openshift_node_dnsmasq/files/networkmanager/99-origin-dns.sh index 51a43d113..5a187710b 100755 --- a/roles/openshift_node_dnsmasq/files/networkmanager/99-origin-dns.sh +++ b/roles/openshift_node_dnsmasq/files/networkmanager/99-origin-dns.sh @@ -47,11 +47,14 @@ EOF # zero out our upstream servers list and feed it into dnsmasq echo -n > /etc/dnsmasq.d/origin-upstream-dns.conf for ns in ${IP4_NAMESERVERS}; do - echo "server=${ns}" >> /etc/dnsmasq.d/origin-upstream-dns.conf + if [[ ! -z $ns ]]; then + echo "server=${ns}" >> /etc/dnsmasq.d/origin-upstream-dns.conf + fi done systemctl restart dnsmasq - sed -i 's/^nameserver.*$/nameserver '"${def_route_ip}"'/g' /etc/resolv.conf + sed -i '0,/^nameserver/ s/^nameserver.*$/nameserver '"${def_route_ip}"'/g' /etc/resolv.conf + if ! grep -q '99-origin-dns.sh' /etc/resolv.conf; then echo "# nameserver updated by /etc/NetworkManager/dispatcher.d/99-origin-dns.sh" >> /etc/resolv.conf fi diff --git a/roles/openshift_node_dnsmasq/handlers/main.yml b/roles/openshift_node_dnsmasq/handlers/main.yml index 7e9e4d299..7d43b6106 100644 --- a/roles/openshift_node_dnsmasq/handlers/main.yml +++ b/roles/openshift_node_dnsmasq/handlers/main.yml @@ -1,5 +1,10 @@ --- - name: restart NetworkManager - service: + service: name: NetworkManager state: restarted + +- name: restart dnsmasq + service: + name: dnsmasq + state: restarted diff --git a/roles/openshift_node_dnsmasq/tasks/main.yml b/roles/openshift_node_dnsmasq/tasks/main.yml index 7147b78f5..bd9a0ffb6 100644 --- a/roles/openshift_node_dnsmasq/tasks/main.yml +++ b/roles/openshift_node_dnsmasq/tasks/main.yml @@ -17,6 +17,17 @@ template: src: origin-dns.conf.j2 dest: /etc/dnsmasq.d/origin-dns.conf + notify: restart dnsmasq + +- name: Deploy additional dnsmasq.conf + template: + src: "{{ openshift_node_dnsmasq_additional_config_file }}" + dest: /etc/dnsmasq.d/openshift-ansible.conf + owner: root + group: root + mode: 0644 + when: openshift_node_dnsmasq_additional_config_file is defined + notify: restart dnsmasq # Dynamic NetworkManager based dispatcher - include: ./network-manager.yml |