changeset 350:85d2c0079af9

Make opcache core and add APCu for object caching Nextcloud wants APCu for in-memory object caching. Opcache has been "core" since v5.5 (althought we're still importing Zend in one place, so maybe we're not doing it right!)
author IBBoard <dev@ibboard.co.uk>
date Sun, 27 Sep 2020 12:59:34 +0100
parents 3717200274ce
children 78a9c5946154
files manifests/templates.pp modules/website/manifests/php.pp
diffstat 2 files changed, 15 insertions(+), 19 deletions(-) [+]
line wrap: on
line diff
--- a/manifests/templates.pp	Sat Sep 26 18:48:30 2020 +0100
+++ b/manifests/templates.pp	Sun Sep 27 12:59:34 2020 +0100
@@ -407,10 +407,9 @@
 
 	#Configure the PHP version to use
 	class { 'website::php':
-		suffix => $php_suffix, 
-		opcache => 'opcache',
+		suffix => $php_suffix,
 		module => ($operatingsystem == 'CentOS' and versioncmp($operatingsystemrelease, '8') >= 0) ? { true => 'remi-7.4', default => undef },
-		extras => [ 'process', 'intl', 'pecl-imagick', 'bcmath', 'pecl-zip', 'json' ],
+		extras => [ 'process', 'intl', 'pecl-imagick', 'bcmath', 'pecl-zip', 'json', 'pecl-apcu' ],
 	}
 
 	#Setup MySQL, using (private) templates to make sure that we set non-std passwords and a default user
--- a/modules/website/manifests/php.pp	Sat Sep 26 18:48:30 2020 +0100
+++ b/modules/website/manifests/php.pp	Sun Sep 27 12:59:34 2020 +0100
@@ -1,7 +1,6 @@
 class website::php(
     $suffix = '',
     $module = undef,
-    $opcache = undef,
     $extras = [],
     ) {
   Package <| tag == 'php-package' |> -> File <| tag == 'php-file' |> ~> Service['httpd']
@@ -49,20 +48,18 @@
     tag => 'php-file',
   }
 
-  if $opcache {
-    package { "php${suffix}-${opcache}":
-      ensure => installed,
-      require => Package[$php_core],
-      tag => 'php-package',
-    }
-    # Use Remi's (and the OS's) naming convention
-    file { '/etc/php.d/opcache.ini':
-      ensure => absent,
-    }
-    file { '/etc/php.d/10-opcache.ini':
-      ensure => present,
-      source => 'puppet:///modules/website/opcache.ini',
-      tag => 'php-file',
-    }
+  package { "php${suffix}-opcache":
+    ensure => installed,
+    require => Package[$php_core],
+    tag => 'php-package',
+  }
+  # Use Remi's (and the OS's) naming convention
+  file { '/etc/php.d/opcache.ini':
+    ensure => absent,
+  }
+  file { '/etc/php.d/10-opcache.ini':
+    ensure => present,
+    source => "puppet:///modules/website/opcache.ini",
+    tag => 'php-file',
   }
 }