changeset 261:c3ecb1e58713

Fix more CentOS 7 vs 8 differences
author IBBoard <dev@ibboard.co.uk>
date Sun, 29 Dec 2019 10:57:43 -0500
parents 5f63afb70415
children 241fbf45e6f3
files manifests/templates.pp modules/website/manifests/init.pp
diffstat 2 files changed, 30 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/manifests/templates.pp	Sun Dec 29 10:57:18 2019 -0500
+++ b/manifests/templates.pp	Sun Dec 29 10:57:43 2019 -0500
@@ -478,8 +478,19 @@
 		$mysqlpackage = 'mariadb'
 		$mysqlsuffix = ''
 
+		# Required for SELinux rule setting/status checks
+		if versioncmp($operatingsystemrelease, '8') >= 0 {
+			$semanage_package_name = 'policycoreutils-python-utils'
+		} else {
+			$semanage_package_name = 'policycoreutils-python'
+		}
+
+		package { 'policycoreutils-python':
+			name => $semanage_package_name,
+			ensure => present,
+		}
+
 		$extra_packages = [
-			'policycoreutils-python', # Required for SELinux
 			'subversion-python', #Required for Trac
 			'perl-Sys-Syslog', #Required for Perl SPF checking
 		]
@@ -532,10 +543,6 @@
 			'authn_core':;
 		}
 	}
-	$apache_packages = [ 'mod_xsendfile' ]
-	package { $apache_packages:
-		ensure => present;
-	}
 
 	#Configure our sites, using templates for the custom fragments where the extra content is too long
 	include adminsite
@@ -641,9 +648,19 @@
 	}
 }
 class devsite {
+	if versioncmp($operatingsystemrelease, '8') >= 0 {
+		# Apache::Mod doesn't map this correctly for CentOS 8 yet
+		$mod_wsgi_package = 'python3-mod_wsgi'
+		$mod_wsgi_lib = 'mod_wsgi_python3.so'
+	} else {
+		$mod_wsgi_package = 'mod_wsgi'
+		$mod_wsgi_lib = undef
+	}
 	apache::mod {
 		# mod_wsgi for Python support
-		'wsgi':;
+		'wsgi':
+		  package => $mod_wsgi_package,
+		  lib => $mod_wsgi_lib,
 	}
 
 	include python::venv
--- a/modules/website/manifests/init.pp	Sun Dec 29 10:57:18 2019 -0500
+++ b/modules/website/manifests/init.pp	Sun Dec 29 10:57:43 2019 -0500
@@ -36,6 +36,7 @@
   }
 
   class { 'apache':
+    vhost_dir => "/etc/httpd/conf.d/vhosts",
     default_mods => false,
     default_vhost => false,
     mpm_module => false,
@@ -132,7 +133,13 @@
       hour => '*/12',
       minute => '21',
     }
+    if versioncmp($operatingsystemrelease, '8') >= 0 {
+      $certbot_package = 'python3-certbot-apache'
+    } else {
+      $certbot_package = 'python2-certbot-apache'
+    }
     package { 'python-certbot-apache':
+      name => $certbot_package,
       ensure => installed,
     }
   }