changeset 320:99e3ca448d55

Fix Remi PHP on CentOS 8 It uses the new "modules" approach, so we need to use a new package provider They also use different signing keys
author IBBoard <dev@ibboard.co.uk>
date Sun, 01 Mar 2020 10:58:00 +0000
parents 6d719622c72f
children cd1bcc06f09c
files common/RPM-GPG-KEY-remi.el8 manifests/templates.pp modules/website/manifests/php.pp
diffstat 3 files changed, 83 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/RPM-GPG-KEY-remi.el8	Sun Mar 01 10:58:00 2020 +0000
@@ -0,0 +1,52 @@
+-----BEGIN PGP PUBLIC KEY BLOCK-----
+
+mQINBFpYvNcBEAC2zo9//ebrNepP/TKSCSwRb2V1VGRLL8SS1RrthG26xr/VTxDC
+p7ZSxYdEcFl/f0ppjrjTp9LPrPqKL+Hjjw1eDJjRWNOXgSNW/uD5TO5vrbTiIzmb
+QIWdMoZ7RUc1pJNHn5DtCjp/6Cm7ntijqxcNYOYd4TEAvv9DPHrj5mYCgLQJ++BT
+oONap0cLCRTcEH8q+GqLfwgnLEJ2g7HJYtmlte6YsuKK23GjpvQaNoAzA72aCr47
+JKVhH1k1Fzaw1M8tTURe5WWZvxGT/lD+pl0Cf39X7bbatR1r9RiijGROhMfndyO/
+wqTKLk6gY6Lm5pj6RTKFg+6AUixcUOn0t2zWY7V4VFNnsxACLcQx04zp9T0lRofc
+FCN0HQAMBzo52stezMvLJlncuMYgHuzbkCf7Avan15MwzOO8rrq5v2tokm6tB0Mf
+SRK7HT04gBVxJT9Y9IiACr7iCcIJcgysbHsR7LbJay+15xWDA6ywdeXt50MKxUpl
+MWeqMnCCdQSNMFRp9hdoKZuo/7PUI+4Wc6ShiFH+WqZ33E6EZbVowC/NHvhrftTP
+yo+t6h/ok6l5j+gLYA+Y9VNtt9kfC7rhl1c+3oh01zkO/WVEFy7RDLOm8ah75oMF
+2hKP4FSfX3cX7n9baPhKcFHx2namblICnoNBAIDvG9H6/6EYVhTM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Nhwc4RhrvomzDTuXIy3kAaORqVxCZgbxj
+sSY0+jqkX/AEU0cR4aiD4fEvMPeHJwoo0vnS1nETi2KZrhEnGa6JhJxe91V0vAxR
+9tBx2KLkl4uYHJELoH9JOcv4WMFMgdoA2MjcIzhH5Cc4t+vQC2cK8lLT7IiGfI57
+vhFCsz+GEqHusDfQgLAp0onI9wwCUwtiFZh4jMOJvk6HMGaGVSP30zh1bGqIPjFS
+qk7agVI=
+=sJgk
+-----END PGP PUBLIC KEY BLOCK-----
--- a/manifests/templates.pp	Sat Feb 29 14:10:26 2020 +0000
+++ b/manifests/templates.pp	Sun Mar 01 10:58:00 2020 +0000
@@ -382,13 +382,18 @@
 			gpgkey => 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi',
 		}
 		yumrepo { 'remirepo-php':
-			mirrorlist => 'http://cdn.remirepo.net/enterprise/$releasever/php73/$basearch/mirror',
-			descr => "PHP7.3 for CentOS from Remi",
+			mirrorlist => 'http://cdn.remirepo.net/enterprise/8/modular/$basearch/mirror',
+			descr => 'Remi\'s Modular repository for Enterprise Linux 8 - $basearch',
 			enabled => 1,
 			failovermethod => 'priority',
 			gpgcheck => 1,
 			gpgkey => 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi',
 		}
+		file { '/etc/pki/rpm-gpg/RPM-GPG-KEY-remi':
+			ensure => present,
+			source => 'puppet:///common/RPM-GPG-KEY-remi.el8',
+			tag => 'repo-config',
+		}
 	} else {
 		yumrepo { 'remirepo-safe':
 			mirrorlist => 'http://cdn.remirepo.net/enterprise/$releasever/safe/mirror',
@@ -406,17 +411,18 @@
 			gpgcheck => 1,
 			gpgkey => 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi',
 		}
-	}
-	file { '/etc/pki/rpm-gpg/RPM-GPG-KEY-remi':
-		ensure => present,
-		source => 'puppet:///common/RPM-GPG-KEY-remi',
-		before => YumRepo['remirepo-php'],
+		file { '/etc/pki/rpm-gpg/RPM-GPG-KEY-remi':
+			ensure => present,
+			source => 'puppet:///common/RPM-GPG-KEY-remi',
+			tag => 'repo-config',
+		}
 	}
 
 	#Configure the PHP version to use
 	class { 'website::php':
 		suffix => $php_suffix, 
 		opcache => 'opcache',
+		module => ($operatingsystem == 'CentOS' and versioncmp($operatingsystemrelease, '8') >= 0) ? { true => 'remi-7.3', default => undef },
 		extras => [ 'process', 'intl', 'pecl-imagick', 'bcmath', 'pecl-zip' ],
 	}
 
--- a/modules/website/manifests/php.pp	Sat Feb 29 14:10:26 2020 +0000
+++ b/modules/website/manifests/php.pp	Sun Mar 01 10:58:00 2020 +0000
@@ -1,17 +1,31 @@
 class website::php(
     $suffix = '',
+    $module = undef,
     $opcache = undef,
     $extras = [],
     ) {
   Package <| tag == 'php-package' |> -> File <| tag == 'php-file' |> ~> Service['httpd']
 
-  if $suffix =~ /^7[1-9]w$/ {
-    $php_core = "mod_php${suffix}"
+  if $module != undef {
+    $php_core = 'php'
+    package { $php_core:
+      provider => 'dnfmodule',
+      ensure => $module,
+      tag => 'php-package',
+    }
   } else {
-    $php_core = "php${suffix}"
+    if $suffix =~ /^7[1-9]w$/ {
+      $php_core = "mod_php${suffix}"
+    } else {
+      $php_core = "php${suffix}"
+    }
+    package { $php_core:
+      ensure => installed,
+      tag => 'php-package',
+    }
   }
 
-  $packages = [ $php_core, "php${suffix}-mbstring", "php${suffix}-xml", "php${suffix}-gd" ]
+  $packages = [ "php${suffix}-mbstring", "php${suffix}-xml", "php${suffix}-gd" ]
   package { $packages:
     ensure => installed,
     tag => 'php-package',