Convert to lowercase true/false
This commit is contained in:
parent
20cb12a66a
commit
fb0c83c738
|
@ -12,8 +12,8 @@ Role Variables
|
||||||
--------------
|
--------------
|
||||||
|
|
||||||
Defaults (config/overwrite required):
|
Defaults (config/overwrite required):
|
||||||
- `monitored_by_nrpe` (defaults: `False`): install/configure NRPE
|
- `monitored_by_nrpe` (defaults: `false`): install/configure NRPE
|
||||||
- `monitored_by_ssh` (defaults: `False`): install/configure SSH incl. wrapper
|
- `monitored_by_ssh` (defaults: `false`): install/configure SSH incl. wrapper
|
||||||
script
|
script
|
||||||
- `monitored_server_ips` (defaults: `[127.0.0.1,]`: list(!) of monitoring server
|
- `monitored_server_ips` (defaults: `[127.0.0.1,]`: list(!) of monitoring server
|
||||||
ips
|
ips
|
||||||
|
@ -22,7 +22,7 @@ Required for SSH:
|
||||||
- `monitored_ssh_key_files` (defaults: `[]`): list(!) of SSH key strings(!)
|
- `monitored_ssh_key_files` (defaults: `[]`): list(!) of SSH key strings(!)
|
||||||
|
|
||||||
Common variables:
|
Common variables:
|
||||||
- `monitored_packages_install` (defaults: `True`): install plugings
|
- `monitored_packages_install` (defaults: `true`): install plugings
|
||||||
- `monitored_sudo_file` (defaults: `/etc/sudoers.d/monitored`): sudoers file
|
- `monitored_sudo_file` (defaults: `/etc/sudoers.d/monitored`): sudoers file
|
||||||
- `monitored_sudo_commands`: list of `sudoers` config lines
|
- `monitored_sudo_commands`: list of `sudoers` config lines
|
||||||
- `monitored_packages_additional(_nrpe|_ssh)`: additional packages to install
|
- `monitored_packages_additional(_nrpe|_ssh)`: additional packages to install
|
||||||
|
@ -44,7 +44,7 @@ Example Playbook
|
||||||
- hosts: all
|
- hosts: all
|
||||||
roles:
|
roles:
|
||||||
- role: monitored
|
- role: monitored
|
||||||
when: monitored_dont|default(False) != True
|
when: monitored_dont|default(false) != true
|
||||||
|
|
||||||
License
|
License
|
||||||
-------
|
-------
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
---
|
---
|
||||||
monitored_by_nrpe: False
|
monitored_by_nrpe: false
|
||||||
monitored_by_ssh: False
|
monitored_by_ssh: false
|
||||||
|
|
||||||
monitored_user: nagios
|
monitored_user: nagios
|
||||||
monitored_group: nagios
|
monitored_group: nagios
|
||||||
|
@ -11,7 +11,7 @@ monitored_password: null
|
||||||
monitored_sudo_file: /etc/sudoers.d/monitored
|
monitored_sudo_file: /etc/sudoers.d/monitored
|
||||||
monitored_sudo_commands: []
|
monitored_sudo_commands: []
|
||||||
|
|
||||||
monitored_packages_install: True
|
monitored_packages_install: true
|
||||||
monitored_packages_predepends: []
|
monitored_packages_predepends: []
|
||||||
monitored_packages_additional: []
|
monitored_packages_additional: []
|
||||||
monitored_packages_additional_nrpe: []
|
monitored_packages_additional_nrpe: []
|
||||||
|
|
|
@ -7,5 +7,5 @@
|
||||||
# when: ansible_os_family == "RedHat" and ansible_distribution != "Fedora"
|
# when: ansible_os_family == "RedHat" and ansible_distribution != "Fedora"
|
||||||
|
|
||||||
- role: monitored
|
- role: monitored
|
||||||
when: monitored_dont|default(False) != True
|
when: monitored_dont|default(false) != true
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,14 @@
|
||||||
---
|
---
|
||||||
|
- debug:
|
||||||
|
msg:
|
||||||
|
- "SSH: {{ monitored_by_ssh }}"
|
||||||
|
- "NRPE: {{ monitored_by_nrpe }}"
|
||||||
|
|
||||||
- name: Sanity checks
|
- name: Sanity checks
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
- monitored_dont|default(False) != True
|
- monitored_dont|default(false) != true
|
||||||
- monitored_by_nrpe == True or monitored_by_ssh == True
|
- monitored_by_nrpe == true or monitored_by_ssh == true
|
||||||
fail_msg: "Neither monitored_by_nrpe nor monitored_by_ssh set to True"
|
fail_msg: "Neither monitored_by_nrpe nor monitored_by_ssh set to True"
|
||||||
|
|
||||||
- name: Gather OS Specific Variables
|
- name: Gather OS Specific Variables
|
||||||
|
@ -18,14 +23,14 @@
|
||||||
package:
|
package:
|
||||||
name: "{{ monitored_packages_predepends }}"
|
name: "{{ monitored_packages_predepends }}"
|
||||||
state: latest
|
state: latest
|
||||||
when: monitored_packages_predepends|default(False)
|
when: monitored_packages_predepends|default(false)
|
||||||
|
|
||||||
- name: "INCLUDE: Create monitoring user"
|
- name: "INCLUDE: Create monitoring user"
|
||||||
import_tasks: user.yml
|
import_tasks: user.yml
|
||||||
|
|
||||||
- name: "INCLUDE: Install always necessary packages"
|
- name: "INCLUDE: Install always necessary packages"
|
||||||
include_tasks: packages.yml
|
include_tasks: packages.yml
|
||||||
when: monitored_packages_install != False
|
when: monitored_packages_install != false
|
||||||
|
|
||||||
- name: "INCLUDE: Copy custom plugins"
|
- name: "INCLUDE: Copy custom plugins"
|
||||||
include_tasks: plugins_custom.yml
|
include_tasks: plugins_custom.yml
|
||||||
|
@ -33,9 +38,9 @@
|
||||||
|
|
||||||
- name: "INCLUDE: Monitoring by NRPE"
|
- name: "INCLUDE: Monitoring by NRPE"
|
||||||
include_tasks: nrpe.yml
|
include_tasks: nrpe.yml
|
||||||
when: monitored_by_nrpe == True
|
when: monitored_by_nrpe == true
|
||||||
|
|
||||||
- name: "INCLUDE: Monitoring by SSH"
|
- name: "INCLUDE: Monitoring by SSH"
|
||||||
include_tasks: ssh.yml
|
include_tasks: ssh.yml
|
||||||
when: monitored_by_ssh == True
|
when: monitored_by_ssh == true
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
name: "{{ monitored_packages_mp }}"
|
name: "{{ monitored_packages_mp }}"
|
||||||
state: latest
|
state: latest
|
||||||
register: monitoringplugins
|
register: monitoringplugins
|
||||||
ignore_errors: True
|
ignore_errors: true
|
||||||
|
|
||||||
- name: Install Nagios-Plugins
|
- name: Install Nagios-Plugins
|
||||||
package:
|
package:
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
group: "{{ monitored_group }}"
|
group: "{{ monitored_group }}"
|
||||||
mode: "{{ monitored_ssh_key_wrapper_mode }}"
|
mode: "{{ monitored_ssh_key_wrapper_mode }}"
|
||||||
backup: yes
|
backup: yes
|
||||||
when: monitored_ssh_key_wrapper_src|default(False) and monitored_ssh_key_wrapper|default(False)
|
when: monitored_ssh_key_wrapper_src|default(false) and monitored_ssh_key_wrapper|default(false)
|
||||||
|
|
||||||
- name: Install additional packages for SSH monitoring
|
- name: Install additional packages for SSH monitoring
|
||||||
package:
|
package:
|
||||||
|
|
|
@ -22,5 +22,5 @@ monitored_packages_nrpe:
|
||||||
- nrpe
|
- nrpe
|
||||||
|
|
||||||
monitored_nrpe_basedir: /etc
|
monitored_nrpe_basedir: /etc
|
||||||
monitored_nrpe_pidfile: False
|
monitored_nrpe_pidfile: false
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
monitored_by_nrpe: False
|
monitored_by_nrpe: false
|
||||||
|
|
||||||
monitored_packages_nrpe: null
|
monitored_packages_nrpe: null
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue