kayobe/ansible/roles/disable-glean/tasks/main.yml
Mark Goddard 533e9ca912 Fix --check argument for overcloud host configure
When running 'kayobe overcloud host configure', there are some tasks
that we need to run even in check mode, to ensure that subsequent tasks
can execute. These tasks should not change the target systems.

Change-Id: Id912ccd7c4bf2a4ccff8d16f2a9aa6ed2127a335
Story: 2004798
Task: 28951
2021-07-08 11:12:43 +01:00

41 lines
1.1 KiB
YAML

---
- name: Check for existing Glean systemd services
command: systemctl list-units glean*.service --no-legend --no-pager --state=loaded
register: glean_services
changed_when: False
check_mode: no
- name: Ensure Glean services are stopped and disabled
service:
name: "{{ item.split()[0] }}"
state: stopped
enabled: no
with_items: "{{ glean_services.stdout_lines }}"
become: True
- name: Find interface configuration files created by Glean
find:
path: "/etc/sysconfig/network-scripts"
pattern: "ifcfg-*"
# This comment is added by Glean to interface configuration files.
contains: "# Automatically generated, do not edit"
register: interface_configs
- name: Ensure interface configuration files created by Glean are removed
file:
path: "{{ item }}"
state: absent
with_items: "{{ interface_configs.files | map(attribute='path') | list }}"
become: True
- name: Ensure Glean artifacts are removed
file:
path: "{{ item }}"
state: absent
with_items:
- "/usr/lib/systemd/system/glean@.service"
- "/etc/udev/rules.d/99-glean.rules"
become: True
notify:
- Reload systemd daemon