Adding temp sensors, sensors and split specific tasks for physical servers

This commit is contained in:
VC
2020-01-05 15:42:55 +01:00
parent abb8f9dce9
commit 369bd4fc62
3 changed files with 44 additions and 17 deletions

View File

@@ -0,0 +1,13 @@
- name: delete squid plugins
shell:
cmd: "rm -f /etc/munin/plugins/squid_*"
warn: False
notify:
- restart munin-node
- name: delete lxc interfaces plugins
shell:
cmd: "rm -f /etc/munin/plugins/if_*veth* /etc/munin/plugins/if_*fw* /etc/munin/plugins/if_*vmbr*"
warn: False
notify:
- restart munin-node

View File

@@ -27,6 +27,7 @@
when: munin_need_reconfigure
## Adding modules for specific functions
# for NginX webservers
- name: install LWP::UserAgent
package:
name: libwww-perl
@@ -35,6 +36,7 @@
- restart munin-node
when: "'webservers' in group_names or 'loadbalancers' in group_names"
# for HAProxy servers
- name: add HAProxy backend module
file:
src: /usr/share/munin/plugins/haproxy_
@@ -44,6 +46,7 @@
- restart munin-node
when: "'loadbalancers' in group_names"
# For MariaDB servers
- name: install Cache::Cache
package:
name: libcache-cache-perl
@@ -52,6 +55,7 @@
- restart munin-node
when: "'mariadbservers' in group_names"
# For PGSQL servers
- name: install DBD::Pg
package:
name: libdbd-pg-perl
@@ -60,7 +64,8 @@
- restart munin-node
when: "'pgsqlservers' in group_names"
- name: "add specific nut value for {{ item }}"
# for NUT (UPS) servers
- name: "add specific nut value for UPS"
file:
path: "/etc/munin/plugins/nutups_eaton3s_{{ item }}"
src: /usr/share/munin/plugins/nutups_
@@ -72,6 +77,11 @@
- charge
- voltages
# for physical servers
- name: execute specific tasks for physical servers
include_tasks: physical_servers.yml
when: "'hypervisors' in group_names"
- name: reconfigure munin-node
shell:
cmd: munin-node-configure --shell | sh
@@ -80,7 +90,7 @@
when: munin_need_reconfigure
## Useless junks for everyone
- name: "delete {{ item }}"
- name: delete useless junks for everyone
file:
path: "/etc/munin/plugins/{{ item }}"
state: absent
@@ -90,7 +100,7 @@
- users
## Useless junks for LXC
- name: "delete {{ item }} from LXC machines"
- name: "delete junks from LXC machines"
file:
path: "/etc/munin/plugins/{{ item }}"
state: absent
@@ -104,18 +114,6 @@
- irqstats
## Useless junks for hypervisors
- name: delete squid plugins
shell:
cmd: "rm -f /etc/munin/plugins/squid_*"
warn: False
notify:
- restart munin-node
when: "'hypervisors' in group_names"
- name: delete lxc interfaces plugins
shell:
cmd: "rm -f /etc/munin/plugins/if_*veth* /etc/munin/plugins/if_*fw* /etc/munin/plugins/if_*vmbr*"
warn: False
notify:
- restart munin-node
- name: execute delete states for hypervisors
include_tasks: hypervisors.yml
when: "'hypervisors' in group_names"

View File

@@ -0,0 +1,16 @@
# for physical servers
- name: install necessary packages for hypervisors
package:
name: lm-sensors
state: present
- name: configure specific munin plugin
file:
path: "/etc/munin/plugins/sensors_{{ item }}"
src: /usr/share/munin/plugins/sensors_
state: link
notify:
- restart munin-node
loop:
- temp