2020-01-14 00:21:44 +00:00
- name : Enable & Start 'munin-node' systemd service
2019-09-14 23:58:46 +00:00
systemd :
name : munin-node
2020-01-14 00:21:44 +00:00
daemon_reload : yes
2019-09-14 23:58:46 +00:00
enabled : yes
state : started
when : munin_enabled | bool
2020-01-14 00:21:44 +00:00
- name : Disable 'munin-node' systemd service
2019-09-14 23:58:46 +00:00
systemd :
name : munin-node
enabled : no
state : stopped
when : not munin_enabled
2020-01-14 00:21:44 +00:00
# Apache
- name : Enable http://box/munin via Apache
command : a2ensite munin24.conf
when : apache_install and munin_enabled # and not nginx_enabled
- name : Disable http://box/munin via Apache
command : a2dissite munin24.conf
when : apache_install and not munin_enabled # or nginx_enabled
- name : Restart Apache systemd service ({{ apache_service }})
systemd :
name : "{{ apache_service }}" # apache2 or httpd, as set in /opt/iiab/iiab/vars/<OS>.yml
state : restarted
when : apache_enabled | bool
# NGINX
2019-09-14 23:58:46 +00:00
2020-01-14 00:21:44 +00:00
- name : Enable http://box/munin via NGINX, by installing {{ nginx_config_dir }}/munin24-nginx.conf from template
template :
src : munin24-nginx.conf.j2
dest : "{{ nginx_config_dir }}/munin24-nginx.conf" # /etc/nginx/conf.d
when : munin_enabled and nginx_enabled
- name : Disable http://box/munin via NGINX, by installing {{ nginx_config_dir }}/munin24-nginx.conf
2019-09-14 23:58:46 +00:00
file :
2020-01-14 00:21:44 +00:00
path : "{{ nginx_config_dir }}/munin24-nginx.conf" # /etc/nginx/conf.d
2019-09-14 23:58:46 +00:00
state : absent
2020-01-14 00:21:44 +00:00
when : not munin_enabled
- name : Restart 'nginx' systemd service
systemd :
name : nginx
state : restarted
when : nginx_enabled | bool
2019-09-14 23:58:46 +00:00
- name : Add 'munin' variable values to {{ iiab_ini_file }}
ini_file :
path : "{{ iiab_ini_file }}"
section : munin
option : "{{ item.option }}"
2020-01-12 02:41:37 +00:00
value : "{{ item.value | string }}"
2019-09-14 23:58:46 +00:00
with_items :
- option : name
value : Munin
- option : description
value : '"Munin is a networked resource monitoring tool that can help analyze resource trends and \"what just happened to kill our performance?\" problems."'
- option : installed
value : "{{ munin_install }}"
- option : enabled
value : "{{ munin_enabled }}"