93084d6ce8
Some checks failed
continuous-integration/drone/pr Build is failing
systemd provides already provides all the fonctionnalities of spawn-fcgi with the exception of the possibility to spawn multiple process to a single socket (it can be done using multiwatch though). So we might as well use the fonctions provided by systemd instead of needing to install a new package and add a layer of indirection in how the fastcgi service is managed. This make for a somewhat simpler service that can be started as an unprivileged user.
47 lines
1.2 KiB
YAML
47 lines
1.2 KiB
YAML
---
|
|
- name: Add munin to hosts
|
|
lineinfile:
|
|
dest: /etc/hosts
|
|
regexp: 'munin$'
|
|
line: '127.0.0.1 munin'
|
|
insertafter: EOF
|
|
|
|
- name: Packages for Munin CGI are installed
|
|
apt:
|
|
name:
|
|
- liblwp-useragent-determined-perl
|
|
- libcgi-fast-perl
|
|
- spawn-fcgi
|
|
state: present
|
|
|
|
- name: Owner for munin-cgi is set to www-data:munin
|
|
shell: "chown --verbose www-data:munin /var/log/munin/munin-cgi-*"
|
|
register: command_result
|
|
changed_when: "'changed' in command_result.stdout"
|
|
args:
|
|
warn: no
|
|
|
|
- name: Mode for munin-cgi is set to 660
|
|
shell: "chmod --verbose 660 /var/log/munin/munin-cgi-*"
|
|
register: command_result
|
|
changed_when: "'changed' in command_result.stdout"
|
|
args:
|
|
warn: no
|
|
|
|
- name: Systemd socket unit for Munin-fcgi is installed
|
|
copy:
|
|
src: systemd/fcgi-munin-graph.socket
|
|
dest: /etc/systemd/system/fcgi-munin-graph.socket
|
|
|
|
- name: Systemd unit for Munin-fcgi is installed
|
|
copy:
|
|
src: systemd/fcgi-munin-graph.service
|
|
dest: /etc/systemd/system/fcgi-munin-graph.service
|
|
|
|
- name: Systemd unit for Munin-fcgi is started
|
|
systemd:
|
|
name: fcgi-munin-graph.socket
|
|
daemon_reload: yes
|
|
enabled: yes
|
|
state: started
|