forked from evolix/ansible-roles
Jérémy Lecour
3a3708e9a6
with_fileglob is executed locally, not remotely. It is useless here. Instead, let's explicitely chown all files with a shell command.
36 lines
846 B
YAML
36 lines
846 B
YAML
---
|
|
- name: Add munin to hosts
|
|
lineinfile:
|
|
dest: /etc/hosts
|
|
regexp: 'munin$'
|
|
line: '127.0.0.1 munin'
|
|
insertafter: EOF
|
|
|
|
- name: Ensure packages for Munin CGI are installed
|
|
apt:
|
|
name: '{{ item }}'
|
|
state: present
|
|
with_items:
|
|
- liblwp-useragent-determined-perl
|
|
- libcgi-fast-perl
|
|
- spawn-fcgi
|
|
|
|
- name: Adjust rights for munin-cgi
|
|
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: Install Init script for Munin-fcgi
|
|
copy:
|
|
src: systemd/spawn-fcgi-munin-graph.service
|
|
dest: /etc/systemd/system/spawn-fcgi-munin-graph.service
|
|
|
|
- name: Enable and start Munin-fcgi
|
|
systemd:
|
|
name: spawn-fcgi-munin-graph
|
|
daemon_reload: yes
|
|
enabled: yes
|
|
state: started
|