Fix host DNS config 1) being edited too soon and 2) not working with NM (#8575)

Signed-off-by: Mac Chaffee <me@macchaffee.com>
This commit is contained in:
Mac Chaffee
2022-02-26 13:29:23 -05:00
committed by GitHub
parent 6d683c98a3
commit b554246502
10 changed files with 46 additions and 30 deletions

View File

@@ -1,18 +1,9 @@
---
- name: NetworkManager | Check if host has NetworkManager
# noqa 303 Should we use service_facts for this?
command: systemctl is-active --quiet NetworkManager.service
register: nm_check
failed_when: false
changed_when: false
check_mode: false
- name: NetworkManager | Ensure NetworkManager conf.d dir
file:
path: "/etc/NetworkManager/conf.d"
state: directory
recurse: yes
when: nm_check.rc == 0
- name: NetworkManager | Prevent NetworkManager from managing Calico interfaces (cali*/tunl*/vxlan.calico)
copy:
@@ -22,7 +13,6 @@
dest: /etc/NetworkManager/conf.d/calico.conf
mode: 0644
when:
- nm_check.rc == 0
- kube_network_plugin == "calico"
notify: Preinstall | reload NetworkManager
@@ -35,5 +25,4 @@
unmanaged-devices+=interface-name:kube-ipvs0;interface-name:nodelocaldns
dest: /etc/NetworkManager/conf.d/k8s.conf
mode: 0644
when: nm_check.rc == 0
notify: Preinstall | reload NetworkManager