mirror of
https://github.com/iiab/iiab.git
synced 2025-02-15 04:32:11 +00:00
Update main.yml
This commit is contained in:
parent
86a083d375
commit
2bc4a04173
1 changed files with 48 additions and 38 deletions
|
@ -1,6 +1,7 @@
|
||||||
- name: Install Munin package
|
- name: Install Munin package (debuntu)
|
||||||
package: name={{ item }}
|
package:
|
||||||
state=present
|
name: "{{ item }}"
|
||||||
|
state: present
|
||||||
with_items:
|
with_items:
|
||||||
- munin
|
- munin
|
||||||
- munin-node
|
- munin-node
|
||||||
|
@ -11,9 +12,10 @@
|
||||||
- download
|
- download
|
||||||
when: is_debuntu
|
when: is_debuntu
|
||||||
|
|
||||||
- name: Install Munin package
|
- name: Install Munin package (OS's other than debuntu)
|
||||||
package: name={{ item }}
|
package:
|
||||||
state=present
|
name: "{{ item }}"
|
||||||
|
state: present
|
||||||
with_items:
|
with_items:
|
||||||
- munin
|
- munin
|
||||||
- munin-node
|
- munin-node
|
||||||
|
@ -22,49 +24,56 @@
|
||||||
when: not is_debuntu
|
when: not is_debuntu
|
||||||
|
|
||||||
- name: Copy Munin config file
|
- name: Copy Munin config file
|
||||||
template: src={{ item.src }}
|
template:
|
||||||
dest={{ item.dest }}
|
src: "{{ item.src }}"
|
||||||
owner=root
|
dest: "{{ item.dest }}"
|
||||||
group=root
|
owner: root
|
||||||
mode=0644
|
group: root
|
||||||
|
mode: 0644
|
||||||
with_items:
|
with_items:
|
||||||
- { src: 'munin.conf.j2', dest: '/etc/munin/munin.conf' }
|
- { src: 'munin.conf.j2', dest: '/etc/munin/munin.conf' }
|
||||||
- { src: 'munin24.conf.j2', dest: '/etc/{{ apache_config_dir }}/munin24.conf' }
|
- { src: 'munin24.conf.j2', dest: '/etc/{{ apache_config_dir }}/munin24.conf' }
|
||||||
|
|
||||||
- name: Create admin user
|
- name: Create admin user
|
||||||
htpasswd: path=/etc/munin/munin-htpasswd
|
htpasswd:
|
||||||
name=Admin
|
path: /etc/munin/munin-htpasswd
|
||||||
password=changeme
|
name: Admin
|
||||||
create=yes
|
password: changeme
|
||||||
state=present
|
create: yes
|
||||||
|
state: present
|
||||||
|
|
||||||
- name: Enable munin-node service
|
- name: Enable munin-node service
|
||||||
service: name=munin-node
|
service:
|
||||||
enabled=yes
|
name: munin-node
|
||||||
state=started
|
enabled: yes
|
||||||
|
state: started
|
||||||
when: munin_enabled
|
when: munin_enabled
|
||||||
|
|
||||||
- name: Enable Apache lookup
|
- name: Enable Apache lookup (debuntu)
|
||||||
file: src=/etc/apache2/sites-available/munin24.conf
|
file:
|
||||||
dest=/etc/apache2/sites-enabled/munin24.conf
|
src: /etc/apache2/sites-available/munin24.conf
|
||||||
state=link
|
dest: /etc/apache2/sites-enabled/munin24.conf
|
||||||
|
state: link
|
||||||
when: munin_enabled and is_debuntu
|
when: munin_enabled and is_debuntu
|
||||||
|
|
||||||
- name: Disable Apache lookup
|
- name: Disable Apache lookup (debuntu)
|
||||||
file: src=/etc/apache2/sites-available/munin24.conf
|
file:
|
||||||
dest=/etc/apache2/sites-enabled/munin24.conf
|
src: /etc/apache2/sites-available/munin24.conf
|
||||||
state=absent
|
dest: /etc/apache2/sites-enabled/munin24.conf
|
||||||
|
state: absent
|
||||||
when: not munin_enabled and is_debuntu
|
when: not munin_enabled and is_debuntu
|
||||||
|
|
||||||
- name: Disable munin-node service when it becomes disabled
|
- name: Disable munin-node service when it becomes disabled
|
||||||
service: name=munin-node
|
service:
|
||||||
enabled=no
|
name: munin-node
|
||||||
state=stopped
|
enabled: no
|
||||||
|
state: stopped
|
||||||
when: not munin_enabled
|
when: not munin_enabled
|
||||||
|
|
||||||
- name: If MySQL is enabled, let Munin monitor it
|
- name: If MySQL is enabled, let Munin monitor it
|
||||||
copy: dest=/etc/munin/plugins/
|
copy:
|
||||||
src={{ item }}
|
src: "{{ item }}"
|
||||||
|
dest: /etc/munin/plugins/
|
||||||
with_items:
|
with_items:
|
||||||
- /usr/share/munin/plugins/mysql_
|
- /usr/share/munin/plugins/mysql_
|
||||||
- /usr/share/munin/plugins/mysql_bytes
|
- /usr/share/munin/plugins/mysql_bytes
|
||||||
|
@ -75,14 +84,15 @@
|
||||||
- /usr/share/munin/plugins/mysql_threads
|
- /usr/share/munin/plugins/mysql_threads
|
||||||
when: mysql_enabled
|
when: mysql_enabled
|
||||||
|
|
||||||
- name: Add munin to service list
|
- name: Add 'munin' to list of services at /etc/iiab/iiab.ini
|
||||||
ini_file: dest='{{ service_filelist }}'
|
ini_file:
|
||||||
section=munin
|
dest: "{{ service_filelist }}"
|
||||||
option='{{ item.option }}'
|
section: munin
|
||||||
value='{{ item.value }}'
|
option: "{{ item.option }}"
|
||||||
|
value: "{{ item.value }}"
|
||||||
with_items:
|
with_items:
|
||||||
- option: name
|
- option: name
|
||||||
value: munin
|
value: Munin
|
||||||
- option: description
|
- 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."'
|
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
|
- option: installed
|
||||||
|
|
Loading…
Reference in a new issue