[mtail] More configuration to select what should be monitored

Signed-off-by: Yohann D'ANELLO <ynerant@crans.org>
certbot_on_virtu
Yohann D'ANELLO 2021-05-28 22:36:51 +02:00
parent 0f59004446
commit 4b70700526
Signed by: _ynerant
GPG Key ID: 3A75C55819C8CF85
5 changed files with 26 additions and 4 deletions

View File

@ -0,0 +1,6 @@
---
glob_mtail:
config:
- dhcpd.mtail
- radiusd.mtail
remove: []

View File

@ -56,3 +56,9 @@ loc_rsyslog_server:
vars:
- name: InputRELPServerRun
value: 20514
loc_mtail:
config:
- dhcpd.mtail
remove:
- radiusd.mtail

4
hosts
View File

@ -105,6 +105,10 @@ linx.adm.crans.org
[mailman]
mailman.adm.crans.org
[mtail]
gulp.cachan-adm.crans.org
tealc.adm.crans.org
[prometheus]
monitoring.adm.crans.org
fyre.cachan-adm.crans.org

View File

@ -44,9 +44,10 @@
# roles: ["prometheus-node-exporter-postfix"]
# Monitor logs with mtail
- hosts: tealc.adm.crans.org,gulp.cachan-adm.crans.org
- hosts: mtail
vars:
mirror: '{{ glob_mirror | default({}) | combine(loc_mirror | default({})) }}'
mtail: '{{ glob_mtail | default({}) | combine(loc_mtail | default({})) }}'
roles:
- mtail

View File

@ -30,9 +30,14 @@
src: "mtail/{{ item }}.j2"
dest: "/etc/mtail/{{ item }}"
mode: 0644
loop:
- dhcpd.mtail
- radiusd.mtail
loop: "{{ mtail.config }}"
notify: Restart mtail
- name: Drop unusued configuration
file:
path: "/etc/mtail/{{ item }}"
state: absent
loop: "{{ mtail.remove }}"
notify: Restart mtail
- name: Indicate role in motd