mirror of
https://github.com/iiab/iiab.git
synced 2025-02-13 19:52:06 +00:00
43 lines
1.3 KiB
YAML
43 lines
1.3 KiB
YAML
- name: "Install 5 packages: libcgi-fast-perl, munin, munin-node, munin-plugins-extra, python3-passlib"
|
|
package:
|
|
name:
|
|
#- libapache2-mod-fcgid
|
|
- libcgi-fast-perl
|
|
- munin
|
|
- munin-node
|
|
- munin-plugins-extra
|
|
- python3-passlib # For Ansible module 'htpasswd' in Ansible collection community.general -- used just below
|
|
state: present
|
|
|
|
- name: Establish username/password Admin/changeme in /etc/munin/munin-htpasswd
|
|
htpasswd:
|
|
path: /etc/munin/munin-htpasswd
|
|
name: "{{ munin_username}}" # Admin
|
|
password: "{{ munin_password }}" # changeme
|
|
|
|
- name: If MySQL is enabled, let Munin monitor it
|
|
copy:
|
|
src: "{{ item }}"
|
|
dest: /etc/munin/plugins/
|
|
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
|
|
|
|
|
|
# RECORD Munin AS INSTALLED
|
|
|
|
- name: "Set 'munin_installed: True'"
|
|
set_fact:
|
|
munin_installed: True
|
|
|
|
- name: "Add 'munin_installed: True' to {{ iiab_state_file }}"
|
|
lineinfile:
|
|
path: "{{ iiab_state_file }}" # /etc/iiab/iiab_state.yml
|
|
regexp: '^munin_installed'
|
|
line: 'munin_installed: True'
|