Browse Source

[queens] Don't use service_facts

Don't use service_facts to check if NetworkManager is enabled.
We're removing facts usage as it has performance issues and
ansible 2.6 service_facts module does not have 'status'.

Depends-On: https://review.opendev.org/c/openstack/tripleo-quickstart/+/777051
Closes-Bug: #1916459
Change-Id: Iefb3d6b3c4800e6948d44c9419f6690d5220a399
changes/25/776925/4
ramishra 2 months ago
parent
commit
b3183235a9
1 changed files with 7 additions and 6 deletions
  1. +7
    -6
      roles/tripleo-bootstrap/tasks/main.yml

+ 7
- 6
roles/tripleo-bootstrap/tasks/main.yml View File

@ -11,16 +11,17 @@
rpm -q {{ item }}
with_items: "{{ packages_bootstrap }}"
- name: Populate service facts
service_facts:
- name: Check NetworkManager status
shell: systemctl is-active NetworkManager.service || systemctl is-enabled NetworkManager.service
failed_when: false
become: true
register: network_manager_enabled
- name: Stop NetworkManager from updating resolv.conf
become: true
when:
- ansible_os_family | lower == 'redhat'
- ansible_distribution_major_version | int >= 7
- "'NetworkManager.service' in ansible_facts.services"
- ansible_facts.services['NetworkManager.service']['status'] == 'enabled'
- network_manager_enabled.rc is defined
- network_manager_enabled.rc == 0
block:
- name: Set 'dns=none' in /etc/NetworkManager/NetworkManager.conf
ini_file:


Loading…
Cancel
Save