From 6881079d12a9fb2cf752a5f56116c1b4d3a7b75d Mon Sep 17 00:00:00 2001 From: Rabi Mishra Date: Thu, 3 Dec 2020 12:58:05 +0530 Subject: [PATCH] Stop NetworkManager from updating resolv.conf cloud-init creates /etc/NetworkManager/conf.d/99-cloud-init.conf, for NetworkManager to not update resolv.conf. However, subsequent update of NetworkManager seems to remove that file as there is no config(noreplace) directive for it. So after an update/upgrade of overcloud nodes, reboot would cleanup the dns entries. cloud-init do configuration only one time during first instance boot. So this would ensure resolv.conf is not touched during subsequent reboots. Change-Id: I989e3f1d14fd33e97933032111cf48166dc5f50c --- .../roles/tripleo_bootstrap/tasks/main.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/tripleo_ansible/roles/tripleo_bootstrap/tasks/main.yml b/tripleo_ansible/roles/tripleo_bootstrap/tasks/main.yml index aaa5b5a2a..2e5c697a2 100644 --- a/tripleo_ansible/roles/tripleo_bootstrap/tasks/main.yml +++ b/tripleo_ansible/roles/tripleo_bootstrap/tasks/main.yml @@ -78,6 +78,25 @@ name: "{{ tripleo_bootstrap_network_service }}" enabled: true +- name: Stop NetworkManager from updating resolv.conf + become: true + when: tripleo_bootstrap_network_service == 'NetworkManager' + block: + - name: Set 'dns=none' in /etc/NetworkManager/NetworkManager.conf + ini_file: + path: /etc/NetworkManager/NetworkManager.conf + state: present + no_extra_spaces: true + section: main + option: dns + value: none + backup: true + + - name: Reload NetworkManager + service: + name: NetworkManager + state: reloaded + - name: Symlink puppet modules under /etc/puppet/modules become: true shell: >-