b6886384b9
All checks were successful
Ansible Lint |Total|New|Outstanding|Fixed|Trend
|:-:|:-:|:-:|:-:|:-:
|2597|7|2590|8|:+1:
Reference build: <a href="https://jenkins.evolix.org/job/gitea/job/ansible-roles/job/unstable/302//ansiblelint">Evolix » ansible-roles » unstable #302</a>
gitea/ansible-roles/pipeline/head This commit looks good
77 lines
1.9 KiB
YAML
77 lines
1.9 KiB
YAML
---
|
|
- name: Install munin check dependencies
|
|
ansible.builtin.apt:
|
|
name: libswitch-perl
|
|
state: present
|
|
tags:
|
|
- redis
|
|
|
|
- ansible.builtin.include_role:
|
|
name: evolix/remount-usr
|
|
tags:
|
|
- redis
|
|
|
|
- name: Create plugin directory
|
|
ansible.builtin.file:
|
|
name: /usr/local/lib/munin/plugins/
|
|
state: directory
|
|
mode: "0755"
|
|
tags:
|
|
- redis
|
|
|
|
- name: Copy redis munin plugin
|
|
ansible.builtin.copy:
|
|
src: munin_redis
|
|
dest: /usr/local/lib/munin/plugins/redis_
|
|
mode: "0755"
|
|
notify: restart munin-node
|
|
tags:
|
|
- redis
|
|
|
|
- name: Enable redis munin plugin
|
|
ansible.builtin.file:
|
|
src: /usr/local/lib/munin/plugins/redis_
|
|
dest: "/etc/munin/plugins/redis_{{ plugin_name }}"
|
|
state: link
|
|
loop:
|
|
- connected_clients
|
|
- key_ratio
|
|
- keys_per_sec
|
|
- per_sec
|
|
- used_keys
|
|
- used_memory
|
|
loop_control:
|
|
loop_var: plugin_name
|
|
notify: restart munin-node
|
|
when: not ansible_check_mode
|
|
tags:
|
|
- redis
|
|
|
|
- name: Count redis condif blocks in munin-node configuration
|
|
ansible.builtin.command:
|
|
cmd: grep -c "\[redis_" /etc/munin/plugin-conf.d/munin-node
|
|
register: munin_redis_blocs_in_config
|
|
failed_when: False
|
|
changed_when: False
|
|
check_mode: no
|
|
|
|
- name: Configure redis plugin for munin
|
|
ansible.builtin.template:
|
|
src: templates/munin-plugin-default.conf.j2
|
|
dest: '/etc/munin/plugin-conf.d/z-evolinux-redis'
|
|
mode: "0740"
|
|
when:
|
|
- redis_password is not none
|
|
- redis_password | length > 0
|
|
- (munin_redis_blocs_in_config.stdout | int) <= 1
|
|
notify: restart munin-node
|
|
tags: redis
|
|
|
|
- name: Warn if multiple instance in munin-plugins configuration
|
|
ansible.builtin.debug:
|
|
msg: "WARNING - It seems you have multiple redis sections in your munin-node configuration - Munin config NOT changed"
|
|
when:
|
|
- redis_password is not none
|
|
- redis_password | length > 0
|
|
- (munin_redis_blocs_in_config.stdout | int) > 1
|