def4d54538
All checks were successful
Ansible Lint |Total|New|Outstanding|Fixed|Trend
|:-:|:-:|:-:|:-:|:-:
|2785|3|2782|3|:-1:
Reference build: <a href="https://jenkins.evolix.org/job/gitea/job/ansible-roles/job/unstable/277//ansiblelint">Evolix » ansible-roles » unstable #277</a>
gitea/ansible-roles/pipeline/head This commit looks good
85 lines
2.6 KiB
YAML
85 lines
2.6 KiB
YAML
---
|
|
|
|
- name: is Munin present ?
|
|
ansible.builtin.stat:
|
|
path: /etc/munin/plugin-conf.d/munin-node
|
|
check_mode: no
|
|
register: munin_node_plugins_config
|
|
|
|
- name: Munin plugins are present and configured
|
|
block:
|
|
|
|
- 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
|
|
ansible.builtin.copy:
|
|
src: munin_plugin_dovecot1
|
|
dest: /usr/local/lib/munin/plugins/dovecot1
|
|
mode: "0755"
|
|
|
|
- name: Install dovecot_stats_ plugin
|
|
# Modified from https://github.com/munin-monitoring/contrib/blob/master/plugins/dovecot/dovecot_stats_
|
|
ansible.builtin.copy:
|
|
src: munin_plugin_dovecot_stats_
|
|
dest: /usr/local/lib/munin/plugins/dovecot_stats_
|
|
mode: "0755"
|
|
tags: dovecot_stats_
|
|
|
|
- name: Sections dovecot1 and dovecot_stats_ are in /etc/munin/plugin-conf.d/zzz-evolinux
|
|
ansible.builtin.lineinfile:
|
|
path: /etc/munin/plugin-conf.d/zzz-evolinux
|
|
regex: '\[{{ item }}\]'
|
|
line: '[{{ item }}]'
|
|
create: yes
|
|
mode: '0644'
|
|
loop: ['dovecot1', 'dovecot_stats_*']
|
|
notify: restart munin-node
|
|
|
|
- name: User root is set for plugins in /etc/munin/plugin-conf.d/zzz-evolinux
|
|
ansible.builtin.lineinfile:
|
|
path: /etc/munin/plugin-conf.d/zzz-evolinux
|
|
regex: '^[[:blank:]]*user root[[:blank:]]*$'
|
|
insertafter: '\[{{ item }}\]'
|
|
line: 'user root'
|
|
create: yes
|
|
mode: '0644'
|
|
loop: ['dovecot1', 'dovecot_stats_*']
|
|
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_
|
|
|
|
when: munin_node_plugins_config.stat.exists
|
|
|