Merge "Gate: only restart network manager if required"

This commit is contained in:
Zuul 2018-09-17 13:49:01 +00:00 committed by Gerrit Code Review
commit d208d55a46

View File

@ -15,8 +15,15 @@
register: network_manager_in_use register: network_manager_in_use
ignore_errors: True ignore_errors: True
- name: DNS | Check if NetworkManager is managing DNS
set_fact:
network_manager_manage_dns: "{{ lookup('ini', 'dns section=main file=/etc/NetworkManager/NetworkManager.conf') }}"
ignore_errors: True
- name: DNS | Disable network NetworkManager management of resolv.conf - name: DNS | Disable network NetworkManager management of resolv.conf
when: network_manager_in_use is succeeded when:
- network_manager_in_use is succeeded
- network_manager_manage_dns != "none"
ini_file: ini_file:
path: /etc/NetworkManager/NetworkManager.conf path: /etc/NetworkManager/NetworkManager.conf
section: main section: main
@ -30,7 +37,9 @@
dest: /etc/resolv.conf dest: /etc/resolv.conf
- name: DNS | Restarting NetworkManager - name: DNS | Restarting NetworkManager
when: network_manager_in_use is succeeded when:
- network_manager_in_use is succeeded
- network_manager_manage_dns != "none"
block: block:
- name: DNS | Restarting NetworkManager Service - name: DNS | Restarting NetworkManager Service
systemd: systemd: