infra/roles/munin_server/tasks/main.yml

56 lines
1.1 KiB
YAML

---
- name: Install munin
apt:
state: present
name: munin
- name: Gather facts from all hosts
setup:
delegate_to: "{{ item }}"
delegate_facts: true
loop: "{{ groups['all'] }}"
- name: Configure munin
template: src=munin.conf.j2 dest=/etc/munin/munin.conf
- name: Configure Munin FastCGI socket
copy:
dest: /etc/systemd/system/munin-graph.socket
owner: root
mode: 0644
content: |
[Unit]
Description=Munin FastCGI Graph Socket
[Socket]
ListenStream=/run/munin/fcgi-graph.sock
[Install]
WantedBy=sockets.target
- name: Configure Munin FastCGI service
copy:
dest: /etc/systemd/system/munin-graph.service
owner: root
mode: 0644
content: |
[Unit]
Description=Munin FastCGI Graph
Requires=munin-graph.socket
[Service]
User=munin
Group=munin
ExecStart=/usr/lib/munin/cgi/munin-cgi-graph
StandardInput=socket
StandardOutput=inherit
StandardError=journal
- name: Enable Munin FastCGI socket
systemd:
name: "munin-graph.socket"
state: started
enabled: true
daemon_reload: true