2020-08-09 01:55:56 +00:00
|
|
|
---
|
|
|
|
- name: Gather instance facts
|
|
|
|
setup:
|
|
|
|
- name: Update APT package cache
|
|
|
|
apt:
|
|
|
|
update_cache: "true"
|
|
|
|
cache_valid_time: "3600"
|
|
|
|
tags:
|
|
|
|
- monit-install
|
|
|
|
- name: Install monit
|
|
|
|
package:
|
|
|
|
name: "{{ packages }}"
|
|
|
|
state: present
|
|
|
|
vars:
|
|
|
|
packages:
|
|
|
|
- monit
|
|
|
|
tags:
|
|
|
|
- monit-install
|
|
|
|
- block:
|
|
|
|
- name: Setup monitrc
|
|
|
|
template:
|
|
|
|
src: monitrc
|
|
|
|
dest: "/etc/monit/monitrc"
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0600
|
|
|
|
notify:
|
|
|
|
- restart monit
|
|
|
|
tags:
|
|
|
|
- monit-config
|
|
|
|
- name: Setup filesystem monitoring
|
|
|
|
template:
|
|
|
|
src: filesystem
|
|
|
|
dest: "/etc/monit/conf.d/{{item.name}}"
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0600
|
|
|
|
loop:
|
|
|
|
"{{ monit_filesystems }}"
|
|
|
|
notify:
|
|
|
|
- restart monit
|
|
|
|
tags:
|
|
|
|
- monit-config
|
|
|
|
- monit-filesystems
|
|
|
|
- name: Setup wireguard monitoring
|
|
|
|
template:
|
|
|
|
src: wireguard
|
|
|
|
dest: "/etc/monit/conf.d/wireguard"
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0600
|
|
|
|
when: monit_wireguard
|
|
|
|
notify:
|
|
|
|
- restart monit
|
|
|
|
tags:
|
|
|
|
- monit-config
|
|
|
|
- monit-wireguard
|
|
|
|
- name: Setup slideshow monitoring
|
|
|
|
template:
|
2020-09-15 23:13:25 +00:00
|
|
|
src: pf-ui
|
|
|
|
dest: "/etc/monit/conf.d/pf-ui"
|
2020-08-09 01:55:56 +00:00
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0600
|
|
|
|
notify:
|
|
|
|
- restart monit
|
|
|
|
tags:
|
|
|
|
- monit-config
|
|
|
|
- monit-fim
|