summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBartek Grzybowski <b.grzybowski@partner.samsung.com>2021-09-23 14:40:22 +0200
committerBartek Grzybowski <b.grzybowski@partner.samsung.com>2021-09-27 13:18:27 +0000
commit4e0ec2607e029edaa5274b079257ac9a3634e0b5 (patch)
tree8736beef3d65c416abcf53ea1510015089a47b6b
parentfb54b60cc08d1c3b3d7d6df1fc7bf3120c6781e8 (diff)
[ANSIBLE] Disable DNS management in Network Manager only if it's installed
Additional check for package presence is required as Centos7.9 cloud image does not have it in contrary to RedHat7.9 Change-Id: I6dcfba0a0fdc1be16ce2ab06eb562168f7814538 Issue-ID: OOM-2837 Signed-off-by: Bartek Grzybowski <b.grzybowski@partner.samsung.com>
-rw-r--r--ansible/roles/package-repository/tasks/main.yml6
1 files changed, 5 insertions, 1 deletions
diff --git a/ansible/roles/package-repository/tasks/main.yml b/ansible/roles/package-repository/tasks/main.yml
index 763ee659..3ccce081 100644
--- a/ansible/roles/package-repository/tasks/main.yml
+++ b/ansible/roles/package-repository/tasks/main.yml
@@ -1,4 +1,8 @@
---
+- name: Get installed packages list
+ package_facts:
+ manager: "auto"
+
- name: Disable DNS management in Network Manager
ini_file:
path: /etc/NetworkManager/NetworkManager.conf
@@ -11,7 +15,7 @@
group: root
mode: 0644
backup: false
- when: ansible_os_family == 'RedHat'
+ when: ansible_os_family == 'RedHat' and 'NetworkManager' in ansible_facts.packages
notify:
- Restart NetworkManager