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 when: munin_need_reconfigure
## Adding modules for specific functions ## Adding modules for specific functions
# for NginX webservers
- name: install LWP::UserAgent - name: install LWP::UserAgent
package: package:
name: libwww-perl name: libwww-perl
@@ -35,6 +36,7 @@
- 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
- name: add HAProxy backend module - name: add HAProxy backend module
file: file:
src: /usr/share/munin/plugins/haproxy_ src: /usr/share/munin/plugins/haproxy_
@@ -44,6 +46,7 @@
- restart munin-node - restart munin-node
when: "'loadbalancers' in group_names" when: "'loadbalancers' in group_names"
# For MariaDB servers
- name: install Cache::Cache - name: install Cache::Cache
package: package:
name: libcache-cache-perl name: libcache-cache-perl
@@ -52,6 +55,7 @@
- restart munin-node - restart munin-node
when: "'mariadbservers' in group_names" when: "'mariadbservers' in group_names"
# For PGSQL servers
- name: install DBD::Pg - name: install DBD::Pg
package: package:
name: libdbd-pg-perl name: libdbd-pg-perl
@@ -60,7 +64,8 @@
- restart munin-node - restart munin-node
when: "'pgsqlservers' in group_names" when: "'pgsqlservers' in group_names"
- name: "add specific nut value for {{ item }}" # for NUT (UPS) servers
- 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_
@@ -72,6 +77,11 @@
- charge - charge
- voltages - 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 - name: reconfigure munin-node
shell: shell:
cmd: munin-node-configure --shell | sh cmd: munin-node-configure --shell | sh
@@ -80,7 +90,7 @@
when: munin_need_reconfigure when: munin_need_reconfigure
## Useless junks for everyone ## Useless junks for everyone
- name: "delete {{ item }}" - name: delete useless junks for everyone
file: file:
path: "/etc/munin/plugins/{{ item }}" path: "/etc/munin/plugins/{{ item }}"
state: absent state: absent
@@ -90,7 +100,7 @@
- users - users
## Useless junks for LXC ## Useless junks for LXC
- name: "delete {{ item }} 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
@@ -104,18 +114,6 @@
- irqstats - irqstats
## Useless junks for hypervisors ## Useless junks for hypervisors
- name: delete squid plugins - name: execute delete states for hypervisors
shell: include_tasks: hypervisors.yml
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
when: "'hypervisors' in group_names" 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