From 115a55787b7b5077ee4364d5e2cc23429f82bf1b Mon Sep 17 00:00:00 2001 From: "Eric D. Helms" Date: Tue, 28 Jul 2020 09:57:21 -0400 Subject: [PATCH] Fixes #30506: Ensure selinux packages are installed before puppet run --- hooks/boot/01-kafo-hook-extensions.rb | 4 ++++ hooks/pre/31_install_scl_packages.rb | 8 -------- hooks/pre/32-install_selinux_packages.rb | 16 ++++++++++++++++ 3 files changed, 20 insertions(+), 8 deletions(-) delete mode 100644 hooks/pre/31_install_scl_packages.rb create mode 100644 hooks/pre/32-install_selinux_packages.rb diff --git a/hooks/boot/01-kafo-hook-extensions.rb b/hooks/boot/01-kafo-hook-extensions.rb index 175a10c9..6718fb62 100644 --- a/hooks/boot/01-kafo-hook-extensions.rb +++ b/hooks/boot/01-kafo-hook-extensions.rb @@ -45,6 +45,10 @@ def foreman_server? module_enabled?('foreman') end + def katello_enabled? + module_enabled?('katello') + end + def devel_scenario? module_enabled?('katello_devel') end diff --git a/hooks/pre/31_install_scl_packages.rb b/hooks/pre/31_install_scl_packages.rb deleted file mode 100644 index cde59ff7..00000000 --- a/hooks/pre/31_install_scl_packages.rb +++ /dev/null @@ -1,8 +0,0 @@ -# Working around https://tickets.puppetlabs.com/browse/PUP-2169 -if el7? - packages = [] - packages << 'rh-postgresql12-postgresql-server' if local_postgresql? - packages << 'rh-redis5-redis' if local_redis? - packages << 'pulpcore-selinux' if pulpcore_enabled? - ensure_packages(packages, 'installed') -end diff --git a/hooks/pre/32-install_selinux_packages.rb b/hooks/pre/32-install_selinux_packages.rb new file mode 100644 index 00000000..d6ac0870 --- /dev/null +++ b/hooks/pre/32-install_selinux_packages.rb @@ -0,0 +1,16 @@ +# Working around https://tickets.puppetlabs.com/browse/PUP-10548 +if facts[:selinux] + packages = [] + + if el7? + packages << 'rh-postgresql12-postgresql-server' if local_postgresql? + packages << 'rh-redis5-redis' if local_redis? + end + + packages << 'foreman-selinux' if foreman_server? + packages << 'katello-selinux' if katello_enabled? + packages << 'candlepin-selinux' if katello_enabled? + packages << 'pulpcore-selinux' if pulpcore_enabled? + + ensure_packages(packages, 'installed') +end