mirror of
https://github.com/iiab/iiab.git
synced 2025-02-15 04:32:11 +00:00
93 lines
2.5 KiB
YAML
93 lines
2.5 KiB
YAML
|
- name: Install munin package
|
||
|
package: name={{ item }}
|
||
|
state=present
|
||
|
with_items:
|
||
|
- munin
|
||
|
- munin-node
|
||
|
- munin-plugins-extra
|
||
|
- libcgi-fast-perl
|
||
|
- libapache2-mod-fcgid
|
||
|
tags:
|
||
|
- download
|
||
|
when: is_debian
|
||
|
|
||
|
- name: Install munin package
|
||
|
package: name={{ item }}
|
||
|
state=present
|
||
|
with_items:
|
||
|
- munin
|
||
|
- munin-node
|
||
|
tags:
|
||
|
- download
|
||
|
when: not is_debian
|
||
|
|
||
|
- name: Copy munin config file
|
||
|
template: src={{ item.src }}
|
||
|
dest={{ item.dest }}
|
||
|
owner=root
|
||
|
group=root
|
||
|
mode=0644
|
||
|
with_items:
|
||
|
- { src: 'munin.conf.j2', dest: '/etc/munin/munin.conf' }
|
||
|
- { src: 'munin24.conf.j2', dest: '/etc/{{ apache_config_dir }}/munin24.conf' }
|
||
|
|
||
|
- name: Create admin user
|
||
|
htpasswd: path=/etc/munin/munin-htpasswd
|
||
|
name=Admin
|
||
|
password=changeme
|
||
|
create=yes
|
||
|
state=present
|
||
|
|
||
|
- name: Enable munin-node service
|
||
|
service: name=munin-node
|
||
|
enabled=yes
|
||
|
state=started
|
||
|
when: munin_enabled
|
||
|
|
||
|
- name: Enable apache lookup
|
||
|
file: src=/etc/apache2/sites-available/munin24.conf
|
||
|
dest=/etc/apache2/sites-enabled/munin24.conf
|
||
|
state=link
|
||
|
when: munin_enabled and is_debian
|
||
|
|
||
|
- name: disable apache lookup
|
||
|
file: src=/etc/apache2/sites-available/munin24.conf
|
||
|
dest=/etc/apache2/sites-enabled/munin24.conf
|
||
|
state=absent
|
||
|
when: not munin_enabled and is_debian
|
||
|
|
||
|
- name: Disable munin-node service when it becomes disabled
|
||
|
service: name=munin-node
|
||
|
enabled=no
|
||
|
state=stopped
|
||
|
when: not munin_enabled
|
||
|
|
||
|
- name: If mysql is enabled, let munin monitor it
|
||
|
copy: dest=/etc/munin/plugins/
|
||
|
src={{ item }}
|
||
|
with_items:
|
||
|
- /usr/share/munin/plugins/mysql_
|
||
|
- /usr/share/munin/plugins/mysql_bytes
|
||
|
- /usr/share/munin/plugins/mysql_innodb
|
||
|
- /usr/share/munin/plugins/mysql_isam_space_
|
||
|
- /usr/share/munin/plugins/mysql_queries
|
||
|
- /usr/share/munin/plugins/mysql_slowqueries
|
||
|
- /usr/share/munin/plugins/mysql_threads
|
||
|
when: mysql_enabled
|
||
|
|
||
|
- name: Add munin to service list
|
||
|
ini_file: dest='{{ service_filelist }}'
|
||
|
section=munin
|
||
|
option='{{ item.option }}'
|
||
|
value='{{ item.value }}'
|
||
|
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 }}"
|
||
|
|