aboutsummaryrefslogtreecommitdiffhomepage
path: root/tasks/uninstall.yml
blob: 1b2c4b95982d98c38fc5bd5ee9050cb71c17c5d9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
- name: Check uninstaller presence
  stat:
    path: "{{ item }}/netdata-uninstaller.sh"
  loop:
    - /usr/libexec/netdata
    - /opt/netdata/usr/libexec/netdata
  register: uninstaller_presence

- name: Uninstall
  command: "{{ item }} --yes --force" # noqa 301
  loop: "{{ uninstallers }}"
  vars:
    uninstallers: "{{ uninstaller_presence.results | selectattr('stat.exists') | map(attribute='invocation.module_args.path') | list }}"