]> git.apps.os.sepia.ceph.com Git - ceph-cm-ansible.git/commitdiff
common: Add EPEL8 support! 475/head
authorDavid Galloway <dgallowa@redhat.com>
Thu, 26 Sep 2019 23:22:44 +0000 (19:22 -0400)
committerDavid Galloway <dgallowa@redhat.com>
Thu, 26 Sep 2019 23:30:18 +0000 (19:30 -0400)
Signed-off-by: David Galloway <dgallowa@redhat.com>
roles/common/defaults/main.yml
roles/common/tasks/main.yml
roles/common/tasks/nagios.yml
roles/common/tasks/nrpe-selinux.yml
roles/common/tasks/yum_systems.yml
roles/common/vars/centos_8.yml [new file with mode: 0644]
roles/common/vars/redhat_8.yml

index d86f2e049d5695886bf8796426552fa4e99a73da..3f6b11dd6b4d86f78d8e33209d0b826be5087ceb 100644 (file)
@@ -43,3 +43,8 @@ yum_timeout: 300
 
 # Override in secrets repo
 nagios_allowed_hosts: "127.0.0.1"
+
+# Override in roles/common/vars/os_version.yml
+nrpe_selinux_packages:
+  - libsemanage-python
+  - policycoreutils-python
index 494bedf82cd492c560b8d66edcaf2c41f0009a28..3b62098223a97a5036d056b3c7cf991ed5268a5e 100644 (file)
 
 # configure nagios (Except OpenSUSE and RHEL8)
 - import_tasks: nagios.yml
-  when:
-    - ansible_pkg_mgr != "zypper"
-    - not (ansible_distribution == "RedHat" and ansible_distribution_major_version == "8")
+  when: ansible_pkg_mgr != "zypper"
   tags:
     - nagios
 
 - name: Get SELinux status
   command: getenforce
   register: selinux_status
-  when: ansible_pkg_mgr == "yum"
+  when: ansible_os_family == "RedHat"
   tags:
     - nagios
 
 # configure selinux for nagios
 - import_tasks: nrpe-selinux.yml
   when: ansible_os_family == "RedHat" and
-        ansible_distribution_major_version != "8" and
         (selinux_status is defined and selinux_status.stdout != "Disabled")
   tags:
     - nagios
index e7a13e71cd328b15741d4e1464ebf6f33cf1c84c..0528672d9a5932bfa42467ab31edd4bcdc6a0b91 100644 (file)
@@ -39,7 +39,6 @@
   with_items: "{{ nrpe_packages }}"
   when:
     - ansible_os_family == "RedHat"
-    - ansible_distribution_major_version|int <= 7
     - have_epel.rc == 0
 
 - name: Install nrpe package and dependencies (Ubuntu)
index e8f39268cf84623d5245e35f5eba9ccdc59de743..62548d12c1866f8eed65d4a3322edb4f4bdbf7b2 100644 (file)
@@ -1,15 +1,13 @@
 ---
 - name: nrpe - Install SELinux dependencies
-  yum:
+  package:
     name: "{{ item }}"
     state: installed
-  with_items:
-    - libsemanage-python
-    - policycoreutils-python
+  with_items: "{{ nrpe_selinux_packages }}"
 
 # ignore_errors in case we don't have any repos
 - name: nrpe - Ensure SELinux policy is up to date
-  yum:
+  package:
     name: selinux-policy-targeted
     state: latest
   ignore_errors: true
index 91bbf070ec32560ca69aad3149a3a99bd18fc051..9318053d743ac8159aaaedf3bd66ba762c733911 100644 (file)
@@ -72,7 +72,7 @@
 
 # create and manage epel.repo
 - import_tasks: epel.yml
-  when: (ansible_distribution == "CentOS" or ansible_distribution == 'RedHat') and ansible_distribution_major_version|int <= 7
+  when: (ansible_distribution == "CentOS" or ansible_distribution == 'RedHat')
   tags:
     - epel
     - repos
diff --git a/roles/common/vars/centos_8.yml b/roles/common/vars/centos_8.yml
new file mode 100644 (file)
index 0000000..746ed3e
--- /dev/null
@@ -0,0 +1,13 @@
+---
+epel_repos:
+  epel:
+    name: "Extra Packages for Enterprise Linux $releasever - $basearch"
+    metalink: https://mirrors.fedoraproject.org/metalink?repo=epel-$releasever&arch=$basearch&infra=$infra&content=$contentdir
+    failovermethod: priority
+    # ternary requires ansible >= 1.9
+    enabled: "{{ enable_epel | ternary(1, 0) }}"
+    gpgcheck: 0
+
+nrpe_selinux_packages:
+  - python3-libsemanage
+  - python3-policycoreutils
index db6f0b78393af221a1a936f92a4fe98d0540532f..8d88ffebea4d4ec74101703c8fa01486069fb4d1 100644 (file)
@@ -2,3 +2,16 @@
 rhsm_repos:
   - rhel-8-for-x86_64-baseos-rpms
   - rhel-8-for-x86_64-appstream-rpms
+
+epel_repos:
+  epel:
+    name: "Extra Packages for Enterprise Linux $releasever - $basearch"
+    metalink: https://mirrors.fedoraproject.org/metalink?repo=epel-$releasever&arch=$basearch&infra=$infra&content=$contentdir
+    failovermethod: priority
+    # ternary requires ansible >= 1.9
+    enabled: "{{ enable_epel | ternary(1, 0) }}"
+    gpgcheck: 0
+
+nrpe_selinux_packages:
+  - python3-libsemanage
+  - python3-policycoreutils