diff --git a/README.md b/README.md index d88a808..2c3da51 100644 --- a/README.md +++ b/README.md @@ -12,8 +12,8 @@ Role Variables -------------- Defaults (config/overwrite required): -- `monitored_by_nrpe` (defaults: `False`): install/configure NRPE -- `monitored_by_ssh` (defaults: `False`): install/configure SSH incl. wrapper +- `monitored_by_nrpe` (defaults: `false`): install/configure NRPE +- `monitored_by_ssh` (defaults: `false`): install/configure SSH incl. wrapper script - `monitored_server_ips` (defaults: `[127.0.0.1,]`: list(!) of monitoring server ips @@ -22,7 +22,7 @@ Required for SSH: - `monitored_ssh_key_files` (defaults: `[]`): list(!) of SSH key strings(!) 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_commands`: list of `sudoers` config lines - `monitored_packages_additional(_nrpe|_ssh)`: additional packages to install @@ -44,7 +44,7 @@ Example Playbook - hosts: all roles: - role: monitored - when: monitored_dont|default(False) != True + when: monitored_dont|default(false) != true License ------- diff --git a/defaults/main.yml b/defaults/main.yml index 2442bb0..0d2ff4f 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,6 +1,6 @@ --- -monitored_by_nrpe: False -monitored_by_ssh: False +monitored_by_nrpe: false +monitored_by_ssh: false monitored_user: nagios monitored_group: nagios @@ -11,7 +11,7 @@ monitored_password: null monitored_sudo_file: /etc/sudoers.d/monitored monitored_sudo_commands: [] -monitored_packages_install: True +monitored_packages_install: true monitored_packages_predepends: [] monitored_packages_additional: [] monitored_packages_additional_nrpe: [] diff --git a/monitored.yml b/monitored.yml index 2294a8f..16f2d6d 100644 --- a/monitored.yml +++ b/monitored.yml @@ -7,5 +7,5 @@ # when: ansible_os_family == "RedHat" and ansible_distribution != "Fedora" - role: monitored - when: monitored_dont|default(False) != True + when: monitored_dont|default(false) != true diff --git a/tasks/main.yml b/tasks/main.yml index fb953a2..a60fe3c 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,9 +1,14 @@ --- +- debug: + msg: + - "SSH: {{ monitored_by_ssh }}" + - "NRPE: {{ monitored_by_nrpe }}" + - name: Sanity checks assert: that: - - monitored_dont|default(False) != True - - monitored_by_nrpe == True or monitored_by_ssh == True + - monitored_dont|default(false) != true + - monitored_by_nrpe == true or monitored_by_ssh == true fail_msg: "Neither monitored_by_nrpe nor monitored_by_ssh set to True" - name: Gather OS Specific Variables @@ -18,14 +23,14 @@ package: name: "{{ monitored_packages_predepends }}" state: latest - when: monitored_packages_predepends|default(False) + when: monitored_packages_predepends|default(false) - name: "INCLUDE: Create monitoring user" import_tasks: user.yml - name: "INCLUDE: Install always necessary packages" include_tasks: packages.yml - when: monitored_packages_install != False + when: monitored_packages_install != false - name: "INCLUDE: Copy custom plugins" include_tasks: plugins_custom.yml @@ -33,9 +38,9 @@ - name: "INCLUDE: Monitoring by NRPE" include_tasks: nrpe.yml - when: monitored_by_nrpe == True + when: monitored_by_nrpe == true - name: "INCLUDE: Monitoring by SSH" include_tasks: ssh.yml - when: monitored_by_ssh == True + when: monitored_by_ssh == true diff --git a/tasks/packages.yml b/tasks/packages.yml index 1c25145..4934d0b 100644 --- a/tasks/packages.yml +++ b/tasks/packages.yml @@ -4,7 +4,7 @@ name: "{{ monitored_packages_mp }}" state: latest register: monitoringplugins - ignore_errors: True + ignore_errors: true - name: Install Nagios-Plugins package: diff --git a/tasks/ssh.yml b/tasks/ssh.yml index a48f8dc..3c1450d 100644 --- a/tasks/ssh.yml +++ b/tasks/ssh.yml @@ -21,7 +21,7 @@ group: "{{ monitored_group }}" mode: "{{ monitored_ssh_key_wrapper_mode }}" 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 package: diff --git a/vars/alpine.yml b/vars/alpine.yml index 48ca7df..c618249 100644 --- a/vars/alpine.yml +++ b/vars/alpine.yml @@ -22,5 +22,5 @@ monitored_packages_nrpe: - nrpe monitored_nrpe_basedir: /etc -monitored_nrpe_pidfile: False +monitored_nrpe_pidfile: false diff --git a/vars/void.yml b/vars/void.yml index 27c15cf..4acd2d8 100644 --- a/vars/void.yml +++ b/vars/void.yml @@ -1,5 +1,5 @@ --- -monitored_by_nrpe: False +monitored_by_nrpe: false monitored_packages_nrpe: null