fix(munin-client): add acpi to useless junk

This commit is contained in:
VC
2024-07-05 11:53:12 +02:00
parent cd850a3872
commit 38850b99f4
2 changed files with 46 additions and 42 deletions

View File

@@ -1,67 +1,69 @@
---
- set_fact: - set_fact:
muninpkgs: muninpkgs:
- muninlite - muninlite
munin_need_reconfigure: False munin_need_reconfigure: false
when: ansible_facts['distribution'] == "LEDE" or ansible_facts['distribution'] == "OpenWRT" or ansible_facts['distribution'] == "OpenWrt" when: ansible_facts['distribution'] == "LEDE" or ansible_facts['distribution'] == "OpenWRT" or ansible_facts['distribution'] == "OpenWrt"
- set_fact: - set_fact:
muninpkgs: muninpkgs:
- munin-node - munin-node
- munin-plugins-core - munin-plugins-core
- munin-plugins-extra - munin-plugins-extra
munin_need_reconfigure: True munin_need_reconfigure: true
when: ansible_facts['distribution'] == "Debian" when: ansible_facts['distribution'] == "Debian"
- name: install munin node packages - name: install munin node packages
package: package:
name: "{{ item }}" name: "{{ item }}"
state: present state: present
loop: "{{ muninpkgs }}" loop: "{{ muninpkgs }}"
- name: munin-node conf file - name: munin-node conf file
template: template:
src: munin-node.conf.j2 src: munin-node.conf.j2
dest: /etc/munin/munin-node.conf dest: /etc/munin/munin-node.conf
notify: notify:
- restart munin-node - restart munin-node
when: munin_need_reconfigure when: munin_need_reconfigure
## Adding modules for specific functions ## Adding modules for specific functions
# for NginX webservers # for NginX webservers
- name: install LWP::UserAgent - name: install LWP::UserAgent
package: package:
name: libwww-perl name: libwww-perl
state: present state: present
notify: notify:
- restart munin-node - restart munin-node
when: "'webservers' in group_names or 'loadbalancers' in group_names" when: "'webservers' in group_names or 'loadbalancers' in group_names"
# for HAProxy servers # for HAProxy servers
- name: add HAProxy backend module - name: add HAProxy backend module
file: file:
src: /usr/share/munin/plugins/haproxy_ src: /usr/share/munin/plugins/haproxy_
dest: /etc/munin/plugins/haproxy_current dest: /etc/munin/plugins/haproxy_current
state: link state: link
notify: notify:
- restart munin-node - restart munin-node
when: "'loadbalancers' in group_names" when: "'loadbalancers' in group_names"
# For MariaDB servers # For MariaDB servers
- name: install Cache::Cache - name: install Cache::Cache
package: package:
name: libcache-cache-perl name: libcache-cache-perl
state: present state: present
notify: notify:
- restart munin-node - restart munin-node
when: "'mariadbservers' in group_names" when: "'mariadbservers' in group_names"
# For PGSQL servers # For PGSQL servers
- name: install DBD::Pg - name: install DBD::Pg
package: package:
name: libdbd-pg-perl name: libdbd-pg-perl
state: present state: present
notify: notify:
- restart munin-node - restart munin-node
when: "'pgsqlservers' in group_names" when: "'pgsqlservers' in group_names"
# For Munin servers # For Munin servers
@@ -72,15 +74,15 @@
# for NUT (UPS) servers # for NUT (UPS) servers
- name: "add specific nut value for UPS" - name: "add specific nut value for UPS"
file: file:
path: "/etc/munin/plugins/nutups_eaton3s_{{ item }}" path: "/etc/munin/plugins/nutups_eaton3s_{{ item }}"
src: /usr/share/munin/plugins/nutups_ src: /usr/share/munin/plugins/nutups_
state: link state: link
notify: notify:
- restart munin-node - restart munin-node
when: "'nut_server' in group_names" when: "'nut_server' in group_names"
loop: loop:
- charge - charge
- voltages - voltages
# for physical servers # for physical servers
- name: execute specific tasks for physical servers - name: execute specific tasks for physical servers
@@ -89,33 +91,34 @@
- name: reconfigure munin-node - name: reconfigure munin-node
shell: shell:
cmd: munin-node-configure --shell | sh cmd: munin-node-configure --shell | sh
notify: notify:
- restart munin-node - restart munin-node
when: munin_need_reconfigure when: munin_need_reconfigure
## Useless junks for everyone ## Useless junks for everyone
- name: delete useless junks for everyone - name: delete useless junks for everyone
file: file:
path: "/etc/munin/plugins/{{ item }}" path: "/etc/munin/plugins/{{ item }}"
state: absent state: absent
when: munin_need_reconfigure when: munin_need_reconfigure
loop: loop:
- users - users
## Useless junks for LXC ## Useless junks for LXC
- name: "delete junks from LXC machines" - name: "delete junks from LXC machines"
file: file:
path: "/etc/munin/plugins/{{ item }}" path: "/etc/munin/plugins/{{ item }}"
state: absent state: absent
notify: notify:
- restart munin-node - restart munin-node
when: ansible_facts['virtualization_type'] == "lxc" when: ansible_facts['virtualization_type'] == "lxc"
loop: loop:
- cpuspeed - acpi
- diskstats - cpuspeed
- entropy - diskstats
- irqstats - entropy
- irqstats
## Useless junks for hypervisors ## Useless junks for hypervisors
- name: execute delete states for hypervisors - name: execute delete states for hypervisors

View File

@@ -113,6 +113,7 @@ whitelist_from *@chichiclothing.com
whitelist_from dmarcreport@microsoft.com whitelist_from dmarcreport@microsoft.com
# Blacklist manuel # Blacklist manuel
blacklist_from *@*.org.ru
blacklist_from *@basretion.eu blacklist_from *@basretion.eu
blacklist_from *@appleawhite.ru blacklist_from *@appleawhite.ru
blacklist_from *@apolnews.fr blacklist_from *@apolnews.fr