2016-09-29 10:26:09 +02:00
|
|
|
---
|
|
|
|
|
2022-09-15 11:45:24 +02:00
|
|
|
- name: Ensure that Munin (and useful dependencies) is installed
|
2017-08-29 03:09:57 +02:00
|
|
|
apt:
|
2019-12-31 15:25:10 +01:00
|
|
|
name:
|
|
|
|
- munin
|
|
|
|
- munin-node
|
|
|
|
- munin-plugins-core
|
|
|
|
- munin-plugins-extra
|
2022-09-15 11:45:24 +02:00
|
|
|
- gawk
|
2017-08-29 03:09:57 +02:00
|
|
|
state: present
|
|
|
|
tags:
|
|
|
|
- munin
|
|
|
|
- packages
|
|
|
|
|
2022-04-19 16:47:22 +02:00
|
|
|
- name: Ensure /usr is still writable
|
|
|
|
include_role:
|
|
|
|
name: evolix/remount-usr
|
|
|
|
|
2017-08-29 03:09:57 +02:00
|
|
|
- block:
|
|
|
|
- name: Replace localdomain in Munin config
|
|
|
|
replace:
|
|
|
|
dest: /etc/munin/munin.conf
|
|
|
|
regexp: 'localhost.localdomain'
|
|
|
|
replace: '{{ ansible_fqdn }}'
|
|
|
|
notify: restart munin-node
|
|
|
|
|
|
|
|
- name: Rename the localdomain data dir
|
2018-07-12 11:04:07 +02:00
|
|
|
shell: "mv /var/lib/munin/localdomain /var/lib/munin/{{ ansible_domain }} && rename \"s/localhost.localdomain/{{ ansible_fqdn }}/\" /var/lib/munin/{{ ansible_domain }}/*"
|
2017-08-29 03:09:57 +02:00
|
|
|
args:
|
|
|
|
creates: /var/lib/munin/{{ ansible_domain }}
|
|
|
|
removes: /var/lib/munin/localdomain
|
|
|
|
notify: restart munin-node
|
|
|
|
|
|
|
|
when: not ansible_hostname == "localdomain"
|
|
|
|
tags:
|
|
|
|
- munin
|
|
|
|
|
2022-04-27 18:00:18 +02:00
|
|
|
- include_role:
|
|
|
|
name: evolix/remount-usr
|
|
|
|
|
2022-04-14 10:45:24 +02:00
|
|
|
- name: Install some Munin plugins (disabled)
|
|
|
|
copy:
|
|
|
|
src: 'plugins/{{ item }}'
|
|
|
|
dest: '/usr/share/munin/plugins/{{ item }}'
|
|
|
|
loop:
|
|
|
|
- dhcp_pool
|
|
|
|
tags:
|
|
|
|
- munin
|
|
|
|
|
2017-08-29 03:09:57 +02:00
|
|
|
- name: Ensure some Munin plugins are disabled
|
|
|
|
file:
|
|
|
|
path: '/etc/munin/plugins/{{ item }}'
|
|
|
|
state: absent
|
2021-05-04 14:18:40 +02:00
|
|
|
loop:
|
2017-08-29 03:09:57 +02:00
|
|
|
- http_loadtime
|
|
|
|
- exim_mailqueue
|
|
|
|
- exim_mailstats
|
|
|
|
- nfsd
|
|
|
|
- nfsd4
|
|
|
|
- nfs_client
|
|
|
|
- nfs4_client
|
|
|
|
notify: restart munin-node
|
|
|
|
tags:
|
|
|
|
- munin
|
|
|
|
|
|
|
|
- name: Ensure some Munin plugins are enabled
|
|
|
|
file:
|
|
|
|
src: "/usr/share/munin/plugins/{{ item }}"
|
|
|
|
dest: "/etc/munin/plugins/{{ item }}"
|
|
|
|
state: link
|
2021-05-04 14:18:40 +02:00
|
|
|
loop:
|
2017-08-29 03:09:57 +02:00
|
|
|
- meminfo
|
|
|
|
- netstat_multi
|
|
|
|
- tcp
|
2018-03-14 15:46:54 +01:00
|
|
|
- postfix_mailqueue
|
|
|
|
- postfix_mailstats
|
|
|
|
- postfix_mailvolume
|
2017-08-29 03:09:57 +02:00
|
|
|
notify: restart munin-node
|
|
|
|
tags:
|
|
|
|
- munin
|
|
|
|
|
2022-09-15 11:45:24 +02:00
|
|
|
- name: Enable sensors_ plugin on dedicated hardware
|
2017-08-29 03:09:57 +02:00
|
|
|
file:
|
|
|
|
src: /usr/share/munin/plugins/sensors_
|
2022-09-15 11:45:24 +02:00
|
|
|
dest: "/etc/munin/plugins/sensors_{{ item }}"
|
2017-08-29 03:09:57 +02:00
|
|
|
state: link
|
2022-09-15 11:45:24 +02:00
|
|
|
with_items:
|
|
|
|
- fan
|
|
|
|
- temp
|
|
|
|
when: ansible_virtualization_role == "host"
|
2017-08-29 03:09:57 +02:00
|
|
|
notify: restart munin-node
|
|
|
|
tags:
|
|
|
|
- munin
|
|
|
|
|
2022-09-15 11:45:24 +02:00
|
|
|
- name: Enable ipmi_ plugin on dedicated hardware
|
|
|
|
file:
|
|
|
|
src: /usr/share/munin/plugins/ipmi_
|
|
|
|
dest: "/etc/munin/plugins/ipmi_{{ item }}"
|
|
|
|
state: link
|
|
|
|
when: ansible_virtualization_role == "host"
|
|
|
|
notify: restart munin-node
|
|
|
|
with_items:
|
|
|
|
- fans
|
|
|
|
- temp
|
|
|
|
- power
|
|
|
|
- volts
|
|
|
|
|
2017-08-29 03:09:57 +02:00
|
|
|
- name: adjustments for grsec kernel
|
|
|
|
blockinfile:
|
|
|
|
dest: /etc/munin/plugin-conf.d/munin-node
|
2019-01-01 20:06:05 +01:00
|
|
|
marker: "# {mark} ANSIBLE MANAGED GRSECURITY CUSTOMIZATIONS"
|
2017-08-29 03:09:57 +02:00
|
|
|
block: |
|
|
|
|
|
|
|
|
[processes]
|
|
|
|
user root
|
|
|
|
|
|
|
|
[vmstat]
|
|
|
|
user root
|
|
|
|
|
|
|
|
[swap]
|
|
|
|
user root
|
2019-12-31 15:32:40 +01:00
|
|
|
when: ansible_kernel is search("-grs-")
|
2021-12-23 16:56:23 +01:00
|
|
|
|
|
|
|
- name: Create override directory for munin-node unit
|
|
|
|
file:
|
|
|
|
name: /etc/systemd/system/munin-node.service.d/
|
|
|
|
state: directory
|
|
|
|
mode: "0755"
|
|
|
|
|
|
|
|
- name: Override is present for protected home
|
|
|
|
ini_file:
|
|
|
|
dest: "/etc/systemd/system/munin-node.service.d/override.conf"
|
|
|
|
section: "Service"
|
|
|
|
option: "ProtectHome"
|
|
|
|
value: "false"
|
|
|
|
state: present
|
2022-02-03 14:18:20 +01:00
|
|
|
create: yes
|
|
|
|
mode: "0644"
|
2022-01-25 11:00:45 +01:00
|
|
|
notify:
|
|
|
|
- systemd daemon-reload
|
|
|
|
- restart munin-node
|