mirror of
https://github.com/FAUSheppy/no-secrets-athq-ansible
synced 2025-12-06 08:51:37 +01:00
update: monitoring conf & git dep
This commit is contained in:
@@ -1,8 +1,16 @@
|
||||
- name: Update apt-get repo and cache
|
||||
apt:
|
||||
update_cache: yes
|
||||
force_apt_get: yes
|
||||
cache_valid_time: 3600
|
||||
changed_when: False
|
||||
|
||||
- name: Install Dependencies
|
||||
apt:
|
||||
name:
|
||||
- python3-nagiosplugin
|
||||
- nagios-plugins-contrib
|
||||
- git
|
||||
state: present
|
||||
|
||||
- name: Clone Passive Monitoring
|
||||
@@ -28,7 +36,15 @@
|
||||
register: postgresql_installed
|
||||
ignore_errors: true
|
||||
changed_when: False
|
||||
check_mode: no
|
||||
|
||||
- name: Set has_postgres variable
|
||||
set_fact:
|
||||
has_postgres: "{{ postgresql_installed.rc == 0 }}"
|
||||
|
||||
- name: Template Remote Monitoring Config
|
||||
template:
|
||||
src: monitoring.conf
|
||||
dest: /etc/monitoring.conf
|
||||
owner: root
|
||||
mode: 644
|
||||
|
||||
@@ -4,8 +4,10 @@ nobody systemd /etc/monitoring-tools/pynagsystemd.py
|
||||
|
||||
{% if has_postgres %}
|
||||
nobody load /usr/lib/nagios/plugins/check_psql
|
||||
{% endif }
|
||||
{% endif %}
|
||||
|
||||
{% if checks %}
|
||||
{% for entry in checks %}
|
||||
{{ entry["user"] }} {{ entry["name"] }} {{ entry["command"] }}
|
||||
{{ entry["user"] }} {{ entry["name"] }} {{ entry["cmd"] }}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
Reference in New Issue
Block a user