Additional package install via variables
- monitored_packages_additional (both SSH and NRPE) - monitored_packages_additional_nrpe (NRPE only) - monitored_packages_additional_ssh (SSH only)
This commit is contained in:
parent
bff23cf3ad
commit
7027df13c9
|
@ -8,6 +8,9 @@ monitored_homedir: /var/lib/nagios
|
|||
monitored_shell: /bin/bash
|
||||
|
||||
monitored_packages_install: True
|
||||
monitored_packages_additional: []
|
||||
monitored_packages_additional_nrpe: []
|
||||
monitored_packages_additional_ssh: []
|
||||
|
||||
monitored_nrpe_server_address: null
|
||||
monitored_nrpe_port: 5666
|
||||
|
|
|
@ -14,14 +14,18 @@
|
|||
- "{{ (ansible_os_family|lower).split(' ')[0] }}.yml"
|
||||
- "defaults.yml"
|
||||
|
||||
- import_tasks: user.yml
|
||||
- name: "INCLUDE: Create monitoring user"
|
||||
import_tasks: user.yml
|
||||
|
||||
- include_tasks: packages.yml
|
||||
- name: "INCLUDE: Install always necessary packages"
|
||||
include_tasks: packages.yml
|
||||
when: monitored_packages_install != False
|
||||
|
||||
- include_tasks: nrpe.yml
|
||||
- name: "INCLUDE: Monitoring by NRPE"
|
||||
include_tasks: nrpe.yml
|
||||
when: monitored_by_nrpe == True
|
||||
|
||||
- include_tasks: ssh.yml
|
||||
- name: "INCLUDE: Monitoring by SSH"
|
||||
include_tasks: ssh.yml
|
||||
when: monitored_by_ssh == True
|
||||
|
||||
|
|
|
@ -35,3 +35,12 @@
|
|||
name: "{{ monitored_nrpe_servicename }}"
|
||||
state: restarted
|
||||
|
||||
|
||||
- name: Instal additional packages for NRPE monitoring
|
||||
package:
|
||||
name: "{{ item }}"
|
||||
state: latest
|
||||
with_items: "{{ monitored_packages_additional_nrpe }}"
|
||||
when: monitored_packages_additional_nrpe
|
||||
|
||||
|
||||
|
|
|
@ -15,3 +15,12 @@
|
|||
with_items: "{{ monitored_packages_np }}"
|
||||
when: monitoringplugins|failed
|
||||
|
||||
|
||||
- name: Instal additional packages
|
||||
package:
|
||||
name: "{{ item }}"
|
||||
state: latest
|
||||
with_items: "{{ monitored_packages_additional }}"
|
||||
when: monitored_packages_additional
|
||||
|
||||
|
||||
|
|
|
@ -24,3 +24,12 @@
|
|||
backup: yes
|
||||
when: monitored_ssh_key_wrapper_src|default(null)
|
||||
|
||||
|
||||
- name: Instal additional packages for SSH monitoring
|
||||
package:
|
||||
name: "{{ item }}"
|
||||
state: latest
|
||||
with_items: "{{ monitored_packages_additional_ssh }}"
|
||||
when: monitored_packages_additional_ssh
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue