first commit

master
Yohann Dedy 2020-04-17 01:29:15 +02:00
commit baae605f91
5 changed files with 92 additions and 0 deletions

6
defaults/main.yml Normal file
View File

@ -0,0 +1,6 @@
---
# defaults file for munin-node
munin_node_host_name: "{{ inventory_hostname }}"
munin_node_ip_bind: "*"
munin_node_port: "4949"

5
handlers/main.yml Normal file
View File

@ -0,0 +1,5 @@
---
# handlers file for munin-node
- name: restart munin-node
action: service name=munin-node state=restarted daemon_reload=yes
listen: "restart services"

31
tasks/main.yml Normal file
View File

@ -0,0 +1,31 @@
---
# tasks file for munin-node
- name: Installation munin-node
apt:
pkg:
- munin-node
ignore_errors: yes
- name: fix munin-node.service for LXC
template:
src: munin-node.service.j2
dest: /lib/systemd/system/munin-node.service
mode: '0777'
backup: yes
when:
- "ansible_facts['virtualization_type'] == 'lxc'"
- "ansible_facts['distribution'] == 'Debian'"
- "ansible_facts['distribution_release'] == 'buster'"
- name: copy munin-node.conf
template:
src: munin-node.conf.j2
dest: /etc/munin/munin-node.conf
backup: yes
notify: restart munin-node
- name: enable munin-node service
systemd:
name: munin-node
enabled: yes

View File

@ -0,0 +1,29 @@
log_level 4
log_file /var/log/munin/munin-node.log
pid_file /var/run/munin/munin-node.pid
background 1
setsid 1
user root
group root
ignore_file [\#~]$
ignore_file DEADJOE$
ignore_file \.bak$
ignore_file %$
ignore_file \.dpkg-(tmp|new|old|dist)$
ignore_file \.rpm(save|new)$
ignore_file \.pod$
{% for ip in munin_servers %}
allow ^{{ ip | regex_replace('\.', '\\\.') }}$
{% endfor %}
allow ^127\.0\.0\.1$
allow ^::1$
host_name {{ munin_node_host_name }}
host {{ munin_node_ip_bind }}
port {{ munin_node_port }}

View File

@ -0,0 +1,21 @@
[Unit]
Description=Munin Node
Documentation=man:munin-node(1) http://munin.readthedocs.org/en/stable-2.0/reference/munin-node.html
After=network-online.target
[Service]
EnvironmentFile=-/etc/default/munin-node
Type=forking
Restart=always
ExecStart=/usr/sbin/munin-node $DAEMON_ARGS
PIDFile=/run/munin/munin-node.pid
PrivateDevices=false
PrivateTmp=false
ProtectHome=false
ProtectSystem=false
[Install]
WantedBy=multi-user.target