diff modules/website/manifests/php.pp @ 402:76d18a918e7f

Switch to more parameters Avoids: * Hard-coding values that need to match other modules across OSes * Using templates when we can use param classes with conditional definitions
author IBBoard <dev@ibboard.co.uk>
date Wed, 20 Apr 2022 19:24:53 +0100
parents f354100b688a
children 0c627ff3a7c3
line wrap: on
line diff
--- a/modules/website/manifests/php.pp	Wed Apr 20 19:13:24 2022 +0100
+++ b/modules/website/manifests/php.pp	Wed Apr 20 19:24:53 2022 +0100
@@ -3,15 +3,12 @@
     $module = undef,
     $extras = [],
     ) {
+  include ::apache::params
   if $osfamily == 'RedHat' {
-    $listener_user = 'apache'
-    $listener_group = 'apache'
     # Work around SELinux "denied execmem" warnings from preg_match JITing
     $pcre_jit = 0
   }
   else {
-    $listener_user = 'www-data'
-    $listener_group = 'www-data'
     $pcre_jit = 1
   }
   class { '::php':
@@ -20,9 +17,9 @@
     fpm => true,
     fpm_pools => {
       'www' => {
-        'listen_owner' => $listener_user,
-        'listen_group' => $listener_group,
         'listen' => '/run/php/php-fpm.sock',
+        'listen_owner' => $::apache::params::user,
+        'listen_group' => $::apache::params::group,
         'slowlog' => '/var/log/php-fpm/www-slow.log',
         'security_limit_extensions' => ['.php', '.html'],
         'php_admin_value' => {