mirror of
https://github.com/FAUSheppy/no-secrets-athq-ansible
synced 2025-12-07 16:41:35 +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
|
- name: Install Dependencies
|
||||||
apt:
|
apt:
|
||||||
name:
|
name:
|
||||||
- python3-nagiosplugin
|
- python3-nagiosplugin
|
||||||
- nagios-plugins-contrib
|
- nagios-plugins-contrib
|
||||||
|
- git
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
- name: Clone Passive Monitoring
|
- name: Clone Passive Monitoring
|
||||||
@@ -28,7 +36,15 @@
|
|||||||
register: postgresql_installed
|
register: postgresql_installed
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
changed_when: False
|
changed_when: False
|
||||||
|
check_mode: no
|
||||||
|
|
||||||
- name: Set has_postgres variable
|
- name: Set has_postgres variable
|
||||||
set_fact:
|
set_fact:
|
||||||
has_postgres: "{{ postgresql_installed.rc == 0 }}"
|
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 %}
|
{% if has_postgres %}
|
||||||
nobody load /usr/lib/nagios/plugins/check_psql
|
nobody load /usr/lib/nagios/plugins/check_psql
|
||||||
{% endif }
|
{% endif %}
|
||||||
|
|
||||||
|
{% if checks %}
|
||||||
{% for entry in checks %}
|
{% for entry in checks %}
|
||||||
{{ entry["user"] }} {{ entry["name"] }} {{ entry["command"] }}
|
{{ entry["user"] }} {{ entry["name"] }} {{ entry["cmd"] }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
{% endif %}
|
||||||
|
|||||||
Reference in New Issue
Block a user