Добавлена установка Grafana: роли, плейбуки и конфигурация
This commit is contained in:
55
playbooks/monitoring/cleanup_grafana.yml
Normal file
55
playbooks/monitoring/cleanup_grafana.yml
Normal file
@ -0,0 +1,55 @@
|
||||
---
|
||||
- name: Clean up Grafana completely
|
||||
hosts: grafana
|
||||
become: yes
|
||||
tasks:
|
||||
- name: Stop and disable Grafana service
|
||||
systemd:
|
||||
name: grafana
|
||||
state: stopped
|
||||
enabled: no
|
||||
daemon_reload: yes
|
||||
ignore_errors: yes
|
||||
|
||||
- name: Remove systemd service file
|
||||
file:
|
||||
path: /etc/systemd/system/grafana.service
|
||||
state: absent
|
||||
|
||||
- name: Remove symlinks
|
||||
file:
|
||||
path: "{{ item }}"
|
||||
state: absent
|
||||
loop:
|
||||
- /usr/local/bin/grafana-server
|
||||
- /usr/local/bin/grafana-cli
|
||||
|
||||
- name: Remove Grafana directories
|
||||
file:
|
||||
path: "{{ item }}"
|
||||
state: absent
|
||||
loop:
|
||||
- /usr/share/grafana
|
||||
- /usr/share/grafana-*
|
||||
- /var/lib/grafana
|
||||
- /var/log/grafana
|
||||
- /etc/grafana
|
||||
|
||||
- name: Remove temporary files
|
||||
file:
|
||||
path: /tmp/grafana-*.tar.gz
|
||||
state: absent
|
||||
|
||||
- name: Remove Grafana user and group
|
||||
user:
|
||||
name: grafana
|
||||
state: absent
|
||||
remove: yes
|
||||
|
||||
- name: Reload systemd
|
||||
systemd:
|
||||
daemon_reload: yes
|
||||
|
||||
- name: Verify cleanup
|
||||
debug:
|
||||
msg: "✅ Grafana полностью удалена с хоста {{ inventory_hostname }}"
|
||||
Reference in New Issue
Block a user