Browse Source

Merge pull request #7765 from abn/network-manager-config-slice

Allow disabling Network Manager managed dns
Scott Dodson 6 years ago
parent
commit
9c943e9f29
1 changed files with 16 additions and 0 deletions
  1. 16 0
      roles/openshift_node/tasks/dnsmasq/network-manager.yml

+ 16 - 0
roles/openshift_node/tasks/dnsmasq/network-manager.yml

@@ -7,4 +7,20 @@
   notify: restart NetworkManager
   when: openshift_node_dnsmasq_install_network_manager_hook | default(true) | bool
 
+- name: Add network manager configuration
+  ini_file:
+    path: /etc/NetworkManager/conf.d/99-origin.conf
+    section: main
+    option: "{{ item.key }}"
+    value: "{{ item.value }}"
+    state: "{{ 'present' if item.present is not defined or item.present else 'absent' }}"
+    no_extra_spaces: yes
+    create: yes
+    mode: 0600
+  notify: restart NetworkManager
+  with_items:
+    - key: dns
+      value: none
+      present: "{{ openshift_node_dnsmasq_disable_network_manager_dns | default(false) | bool }}"
+
 - meta: flush_handlers