Files
no-secrets-athq-ansible/roles/monitoring-client/tasks/main.yaml

51 lines
1.1 KiB
YAML

- 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
git:
repo: https://github.com/FAUSheppy/icinga-passive-checks-monitoring
dest: "/etc/monitoring/"
version: master
- name: Clone Monitoring Tools
git:
repo: https://github.com/FAUSheppy/monitoring-tools
dest: "/etc/monitoring-tools/"
version: master
- name: Copy nsca-ng and send_nsca to /bin/
copy:
src: pynagsystemd.py
dest: /bin/pynagsystemd.py
mode: 0755
- name: Check if PostgreSQL is installed
command: dpkg -s postgresql
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