2016-12-14 17:57:19 +00:00
|
|
|
---
|
2019-11-13 20:49:59 +00:00
|
|
|
- name: Sanity checks
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- monitored_dont|default(False) != True
|
2020-09-23 13:01:04 +00:00
|
|
|
- monitored_by_nrpe == True or monitored_by_ssh == True
|
2021-02-18 12:00:21 +00:00
|
|
|
fail_msg: "Neither monitored_by_nrpe nor monitored_by_ssh set to True"
|
2016-12-14 17:57:19 +00:00
|
|
|
|
|
|
|
- name: Gather OS Specific Variables
|
|
|
|
include_vars: "{{ item }}"
|
|
|
|
with_first_found:
|
2018-03-13 18:05:20 +00:00
|
|
|
- "{{ (ansible_distribution|lower).split(' ')[0] }}-{{ (ansible_distribution_version|lower).split(' ')[0] }}.yml"
|
|
|
|
- "{{ (ansible_distribution|lower).split(' ')[0] }}-{{ (ansible_distribution_major_version|lower).split(' ')[0] }}.yml"
|
|
|
|
- "{{ (ansible_distribution|lower).split(' ')[0] }}.yml"
|
|
|
|
- "{{ (ansible_os_family|lower).split(' ')[0] }}.yml"
|
2018-04-22 12:50:15 +00:00
|
|
|
|
|
|
|
- name: "Install dependencies"
|
|
|
|
package:
|
|
|
|
name: "{{ monitored_packages_predepends }}"
|
|
|
|
state: latest
|
2019-11-13 20:49:59 +00:00
|
|
|
when: monitored_packages_predepends|default(False)
|
2016-12-14 17:57:19 +00:00
|
|
|
|
2018-04-22 12:14:03 +00:00
|
|
|
- name: "INCLUDE: Create monitoring user"
|
|
|
|
import_tasks: user.yml
|
2016-12-14 17:57:19 +00:00
|
|
|
|
2018-04-22 12:14:03 +00:00
|
|
|
- name: "INCLUDE: Install always necessary packages"
|
|
|
|
include_tasks: packages.yml
|
2016-12-14 17:57:19 +00:00
|
|
|
when: monitored_packages_install != False
|
|
|
|
|
2018-10-02 20:44:11 +00:00
|
|
|
- name: "INCLUDE: Copy custom plugins"
|
|
|
|
include_tasks: plugins_custom.yml
|
|
|
|
when: monitored_plugins_custom|default([]) != []
|
|
|
|
|
2018-04-22 12:14:03 +00:00
|
|
|
- name: "INCLUDE: Monitoring by NRPE"
|
|
|
|
include_tasks: nrpe.yml
|
2016-12-14 17:57:19 +00:00
|
|
|
when: monitored_by_nrpe == True
|
|
|
|
|
2018-04-22 12:14:03 +00:00
|
|
|
- name: "INCLUDE: Monitoring by SSH"
|
|
|
|
include_tasks: ssh.yml
|
2016-12-14 17:57:19 +00:00
|
|
|
when: monitored_by_ssh == True
|
|
|
|
|