]> git.apps.os.sepia.ceph.com Git - ceph-cm-ansible.git/commitdiff
common: Add nrpe support to zypper systems 649/head
authorDavid Galloway <dgallowa@redhat.com>
Fri, 1 Oct 2021 16:11:32 +0000 (12:11 -0400)
committerDavid Galloway <dgallowa@redhat.com>
Fri, 1 Oct 2021 16:11:32 +0000 (12:11 -0400)
Signed-off-by: David Galloway <dgallowa@redhat.com>
roles/common/tasks/main.yml
roles/common/tasks/nagios.yml
roles/common/vars/dnf_systems.yml [new symlink]
roles/common/vars/zypper_systems.yml [new file with mode: 0644]

index c03c3c60857fa1fba50e93b7f9639e8d575ed0bc..9c4200f63b3c1afbd4593f6f65b058df31576751 100644 (file)
     - monitoring-scripts
     - nagios
 
-# configure nagios (Except OpenSUSE and CentOS 9 Stream)
+# configure nagios (Except CentOS 9 Stream)
 - import_tasks: nagios.yml
-  when:
-    - ansible_pkg_mgr != "zypper"
-    - not (ansible_distribution == "CentOS" and ansible_distribution_major_version == "9")
+  when: not (ansible_distribution == "CentOS" and ansible_distribution_major_version == "9")
   tags:
     - nagios
 
index cc926bf22e5cfd3a0d065fae7907dfad75f1864f..e162e9ac5388360a5cc2c792001dd41994bc379c 100644 (file)
@@ -1,11 +1,6 @@
 ---
-- name: Include apt_system vars
-  include_vars: apt_systems.yml
-  when: ansible_pkg_mgr == "apt"
-
-- name: Include yum_systems vars
-  include_vars: yum_systems.yml
-  when: ansible_os_family == "RedHat"
+- name: "Include {{ ansible_pkg_mgr }}_system vars"
+  include_vars: "{{ ansible_pkg_mgr }}_systems.yml"
 
 # Returns 0 if found and 1 if not found
 # Task fails if not found.  Hence ignore_errors: true
     - ansible_os_family == "RedHat"
     - have_epel.rc == 0
 
-- name: Install nrpe package and dependencies (Ubuntu/Fedora)
+- name: Install nrpe package and dependencies (non-RHEL/CentOS)
   package:
     name: "{{ nrpe_packages|list }}"
     state: latest
-  when: ansible_pkg_mgr == "apt" or ansible_distribution == "Fedora"
+  when: ansible_os_family != "RedHat"
 
 - name: Upload nagios sudoers.d for raid utilities.
   template:
diff --git a/roles/common/vars/dnf_systems.yml b/roles/common/vars/dnf_systems.yml
new file mode 120000 (symlink)
index 0000000..3eacc96
--- /dev/null
@@ -0,0 +1 @@
+yum_systems.yml
\ No newline at end of file
diff --git a/roles/common/vars/zypper_systems.yml b/roles/common/vars/zypper_systems.yml
new file mode 100644 (file)
index 0000000..c655e01
--- /dev/null
@@ -0,0 +1,9 @@
+---
+nrpe_service_name: nrpe
+nrpe_user: nrpe
+nrpe_group: nrpe
+nagios_plugins_directory: /usr/lib/nagios/plugins
+
+nrpe_packages:
+  - nrpe
+  - monitoring-plugins-nrpe