33 lines
847 B
YAML
33 lines
847 B
YAML
- name: Stop and disable node_exporter service
|
|
ansible.builtin.systemd:
|
|
name: node_exporter
|
|
state: stopped
|
|
enabled: no
|
|
ignore_errors: yes
|
|
|
|
- name: Remove systemd unit file for node_exporter
|
|
ansible.builtin.file:
|
|
path: "{{ node_exporter_systemd_unit_path }}"
|
|
state: absent
|
|
|
|
- name: Remove symlink /usr/local/bin/node_exporter
|
|
ansible.builtin.file:
|
|
path: /usr/local/bin/node_exporter
|
|
state: absent
|
|
|
|
- name: Remove node_exporter installation directory
|
|
ansible.builtin.file:
|
|
path: "{{ node_exporter_install_dir }}"
|
|
state: absent
|
|
|
|
- name: Remove user "{{ node_exporter_user }}"
|
|
ansible.builtin.user:
|
|
name: "{{ node_exporter_user }}"
|
|
state: absent
|
|
remove: yes
|
|
|
|
- name: Remove group "{{ node_exporter_group }}"
|
|
ansible.builtin.group:
|
|
name: "{{ node_exporter_group }}"
|
|
state: absent
|