summaryrefslogtreecommitdiffstats
path: root/ansible/roles
diff options
context:
space:
mode:
authorMateusz Pilat <m.pilat@partner.samsung.com>2020-02-12 10:19:28 +0100
committerMateusz Pilat <m.pilat@partner.samsung.com>2020-02-17 15:23:10 +0100
commit3841ad91a84f683e2f56cd9ce28b67ba3635ea4e (patch)
tree70c96f5e6e5eab855dede190472c30a35f945440 /ansible/roles
parent6ac532c0d6cd76dd5fef7cee280fdc1f43ea9222 (diff)
Fix: Losing dns configuration after reboot
Issue-ID: OOM-2295 Signed-off-by: Mateusz Pilat <m.pilat@partner.samsung.com> Change-Id: Ic10203be6fc2cd2c805679a293efa0f2ddea9465
Diffstat (limited to 'ansible/roles')
-rw-r--r--ansible/roles/package-repository/handlers/main.yml6
-rw-r--r--ansible/roles/package-repository/tasks/main.yml16
2 files changed, 22 insertions, 0 deletions
diff --git a/ansible/roles/package-repository/handlers/main.yml b/ansible/roles/package-repository/handlers/main.yml
new file mode 100644
index 00000000..304cc873
--- /dev/null
+++ b/ansible/roles/package-repository/handlers/main.yml
@@ -0,0 +1,6 @@
+---
+- name: Restart NetworkManager
+ systemd:
+ name: NetworkManager
+ state: restarted
+ when: ansible_connection != 'docker'
diff --git a/ansible/roles/package-repository/tasks/main.yml b/ansible/roles/package-repository/tasks/main.yml
index 7dc2e76f..e2a5fd46 100644
--- a/ansible/roles/package-repository/tasks/main.yml
+++ b/ansible/roles/package-repository/tasks/main.yml
@@ -1,4 +1,20 @@
---
+- name: Disable DNS management in Network Manager
+ ini_file:
+ path: /etc/NetworkManager/NetworkManager.conf
+ state: present
+ no_extra_spaces: true
+ section: main
+ option: dns
+ value: none
+ owner: root
+ group: root
+ mode: 0644
+ backup: false
+ when: ansible_os_family == 'RedHat'
+ notify:
+ - Restart NetworkManager
+
- name: Setup resolv.conf for node to find package repository by name from infra
lineinfile:
line: "nameserver {{ hostvars[groups.infrastructure[0]].cluster_ip }}"