61f2096fad
Use “when: not ansible_check_mode” or “when <file>.stat.exists or not
ansible_check_mode” in order to provide a meaningful diff if possible.
This is an improvement from the previously reverted commit
1728eaee68
.
57 lines
1.1 KiB
YAML
57 lines
1.1 KiB
YAML
---
|
|
|
|
- name: "Install munin-node and core plugins packages"
|
|
apt:
|
|
name:
|
|
- munin-node
|
|
- munin-plugins-core
|
|
state: present
|
|
tags:
|
|
- apache
|
|
- munin
|
|
|
|
- name: "Enable Munin plugins"
|
|
file:
|
|
src: "/usr/share/munin/plugins/{{ item }}"
|
|
dest: "/etc/munin/plugins/{{ item }}"
|
|
state: link
|
|
loop:
|
|
- apache_accesses
|
|
- apache_processes
|
|
- apache_volume
|
|
notify: restart munin-node
|
|
tags:
|
|
- apache
|
|
- munin
|
|
when: not ansible_check_mode
|
|
|
|
- name: "Install fcgi packages for Munin graphs"
|
|
apt:
|
|
name:
|
|
- libapache2-mod-fcgid
|
|
- libcgi-fast-perl
|
|
state: present
|
|
notify: reload apache
|
|
tags:
|
|
- apache
|
|
- munin
|
|
|
|
- name: "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
|
|
when: not ansible_check_mode
|
|
|
|
- name: "Apache has access to /var/log/munin/"
|
|
file:
|
|
path: /var/log/munin/
|
|
group: www-data
|
|
tags:
|
|
- apache
|
|
- munin
|
|
when: not ansible_check_mode
|