diff options
Diffstat (limited to 'tasks/uninstall.yml')
-rw-r--r-- | tasks/uninstall.yml | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tasks/uninstall.yml b/tasks/uninstall.yml new file mode 100644 index 0000000..1b2c4b9 --- /dev/null +++ b/tasks/uninstall.yml | |||
@@ -0,0 +1,13 @@ | |||
1 | - name: Check uninstaller presence | ||
2 | stat: | ||
3 | path: "{{ item }}/netdata-uninstaller.sh" | ||
4 | loop: | ||
5 | - /usr/libexec/netdata | ||
6 | - /opt/netdata/usr/libexec/netdata | ||
7 | register: uninstaller_presence | ||
8 | |||
9 | - name: Uninstall | ||
10 | command: "{{ item }} --yes --force" # noqa 301 | ||
11 | loop: "{{ uninstallers }}" | ||
12 | vars: | ||
13 | uninstallers: "{{ uninstaller_presence.results | selectattr('stat.exists') | map(attribute='invocation.module_args.path') | list }}" | ||