kayobe/ansible/roles/disable-glean/tasks/main.yml
Mark Goddard 9e858dc55b Small fixes for disable-glean role
Don't stop glean services which are not loaded.
2017-05-29 16:55:54 +01:00

40 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
- 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