69 lines
1.6 KiB
YAML
69 lines
1.6 KiB
YAML
- set_fact:
|
|
muninpkgs:
|
|
- muninlite
|
|
munin_need_reconfigure: False
|
|
when: ansible_facts['distribution'] == "LEDE" or ansible_facts['distribution'] == "OpenWRT"
|
|
|
|
- set_fact:
|
|
muninpkgs:
|
|
- munin-node
|
|
- munin-plugins-core
|
|
- munin-plugins-extra
|
|
munin_need_reconfigure: True
|
|
when: ansible_facts['distribution'] == "Debian"
|
|
|
|
- name: install munin node packages
|
|
package:
|
|
name: "{{ item }}"
|
|
state: present
|
|
loop: "{{ muninpkgs }}"
|
|
|
|
- name: munin-node conf file
|
|
template:
|
|
src: munin-node.conf.j2
|
|
dest: /etc/munin/munin-node.conf
|
|
notify:
|
|
- restart munin-node
|
|
when: munin_need_reconfigure
|
|
|
|
- name: install LWP::UserAgent
|
|
package:
|
|
name: libwww-perl
|
|
state: present
|
|
notify:
|
|
- restart munin-node
|
|
when: "'webservers' in group_names"
|
|
|
|
- name: reconfigure munin-node
|
|
shell:
|
|
cmd: munin-node-configure --shell | sh
|
|
notify:
|
|
- restart munin-node
|
|
when: munin_need_reconfigure
|
|
|
|
## Useless junks for LXC
|
|
- name: delete diskstats from LXC machines
|
|
file:
|
|
path: /etc/munin/plugins/diskstats
|
|
state: absent
|
|
notify:
|
|
- restart munin-node
|
|
when: ansible_facts['virtualization_type'] == "lxc"
|
|
|
|
## Useless junks for hypervisors
|
|
- name: delete squid plugins
|
|
shell:
|
|
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"
|