Merge branch 'apache-munin' into unstable

This commit is contained in:
Benoît S. 2017-10-06 15:42:45 +02:00
commit 50cba28f7b
3 changed files with 65 additions and 4 deletions

View file

@ -135,6 +135,20 @@
tags:
- apache
- include: phpmyadmin.yml
when: _default_index.stat.exists
- name: Check if Munin plugins exists
stat:
path: /etc/munin/plugins/
register: _munin_plugins
check_mode: no
tags:
- apache
- include: munin.yml
when: _munin_plugins.stat.exists
# - block:
# - name: generate random string for serverstatus suffix
# command: "apg -a 1 -M N -n 1"

View file

@ -21,3 +21,48 @@
tags:
- apache
- munin
---
- name: install packages for Apache and Munin
apt:
name: "{{ item }}"
state: installed
with_items:
- libapache2-mod-fcgid
- libcgi-fast-perl
notify: reload apache
tags:
- apache
- munin
- name: be sure to enable libapache2-mod-fcgid
command: a2enmod fcgid
register: cmd_enable_fcgid
changed_when: "'Module fcgid already enabled' not in cmd_enable_fcgid.stdout"
notify: restart apache
tags:
- apache
- munin
- name: change group for /var/log/munin/
file:
path: /var/log/munin/
group: www-data
tags:
- apache
- munin
- name: install munin plugins
file:
src: "/etc/munin/plugins/{{ item }}"
dest: "/usr/share/munin/plugins/{{ item }}"
state: link
with_items:
- apache_accesses
- apache_processes
- apache_volume
notify: restart munin-node
tags:
- apache
- munin

View file

@ -19,11 +19,13 @@
Require all denied
Include /etc/apache2/ipaddr_whitelist.conf
</Directory>
<Directory /usr/lib/munin/cgi/>
Options -Indexes
# munin-cgi-graph, used for zooming on graphs.
ScriptAlias /munin-cgi/munin-cgi-graph /usr/lib/munin/cgi/munin-cgi-graph
<Location /munin-cgi/munin-cgi-graph>
Options +ExecCGI
Require all denied
Include /etc/apache2/ipaddr_whitelist.conf
</Directory>
Include /etc/apache2/private_ipaddr_whitelist.conf
</Location>
# For CGI Scripts. We need to set Directory directive as ScriptAlias take precedence.
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/