2017-10-10 00:03:22 +02:00
|
|
|
---
|
|
|
|
|
|
|
|
- name: is Munin present ?
|
2023-03-20 23:33:19 +01:00
|
|
|
ansible.builtin.stat:
|
2017-10-10 00:03:22 +02:00
|
|
|
path: /etc/munin/plugin-conf.d/munin-node
|
|
|
|
check_mode: no
|
|
|
|
register: munin_node_plugins_config
|
|
|
|
|
2019-12-31 16:56:03 +01:00
|
|
|
- name: Munin plugins are present and configured
|
|
|
|
block:
|
2023-06-23 11:26:35 +02:00
|
|
|
|
|
|
|
- name: Disable dovecot plugin
|
|
|
|
ansible.builtin.file:
|
|
|
|
path: /etc/munin/plugins/dovecot
|
|
|
|
state: absent
|
|
|
|
|
|
|
|
- name: Remove dovecot plugin conf
|
|
|
|
ansible.builtin.file:
|
|
|
|
path: /etc/munin/plugin-conf.d/dovecot
|
|
|
|
state: absent
|
|
|
|
|
|
|
|
- name: "Remount /usr if needed"
|
|
|
|
ansible.builtin.include_role:
|
|
|
|
name: remount-usr
|
|
|
|
|
|
|
|
- name: Ensures /usr/local/lib/munin/plugins/ dir exists
|
|
|
|
ansible.builtin.file:
|
|
|
|
path: "/usr/local/lib/munin/plugins/"
|
|
|
|
state: directory
|
|
|
|
mode: "0755"
|
|
|
|
|
|
|
|
- name: Install dovecot1 plugin
|
|
|
|
# Original from https://github.com/munin-monitoring/contrib/blob/master/plugins/dovecot/dovecot1
|
2023-03-20 23:33:19 +01:00
|
|
|
ansible.builtin.copy:
|
2023-06-23 11:26:35 +02:00
|
|
|
src: munin_plugin_dovecot1
|
|
|
|
dest: /usr/local/lib/munin/plugins/dovecot1
|
2019-12-31 16:56:03 +01:00
|
|
|
mode: "0755"
|
2017-10-10 00:03:22 +02:00
|
|
|
|
2023-06-23 11:26:35 +02:00
|
|
|
- name: Install dovecot_stats_ plugin
|
|
|
|
# Modified from https://github.com/munin-monitoring/contrib/blob/master/plugins/dovecot/dovecot_stats_
|
2023-03-20 23:33:19 +01:00
|
|
|
ansible.builtin.copy:
|
2023-06-23 11:26:35 +02:00
|
|
|
src: munin_plugin_dovecot_stats_
|
|
|
|
dest: /usr/local/lib/munin/plugins/dovecot_stats_
|
|
|
|
mode: "0755"
|
|
|
|
tags: dovecot_stats_
|
|
|
|
|
2023-07-21 16:33:15 +02:00
|
|
|
- name: Copy Munin config
|
|
|
|
ansible.builtin.copy:
|
|
|
|
src: z-evolinux-dovecot.conf
|
|
|
|
dest: /etc/munin/plugin-conf.d/z-evolinux-dovecot
|
2023-06-27 17:09:19 +02:00
|
|
|
mode: '0644'
|
2023-06-23 11:26:35 +02:00
|
|
|
notify: restart munin-node
|
|
|
|
|
|
|
|
- name: Enable dovecot1 plugin
|
|
|
|
ansible.builtin.file:
|
|
|
|
src: "/usr/local/lib/munin/plugins/dovecot1"
|
|
|
|
dest: "/etc/munin/plugins/dovecot1"
|
|
|
|
state: link
|
|
|
|
when: not ansible_check_mode
|
|
|
|
|
|
|
|
- name: Enable wildcard dovecot_stats_ plugin for all domains
|
|
|
|
ansible.builtin.file:
|
|
|
|
src: "/usr/local/lib/munin/plugins/dovecot_stats_"
|
|
|
|
dest: "/etc/munin/plugins/dovecot_stats_global"
|
|
|
|
state: link
|
|
|
|
when: not ansible_check_mode
|
|
|
|
tags: dovecot_stats_
|
2017-10-10 00:03:22 +02:00
|
|
|
|
|
|
|
when: munin_node_plugins_config.stat.exists
|
2023-06-23 11:26:35 +02:00
|
|
|
|