# HG changeset patch # User IBBoard # Date 1650479093 -3600 # Node ID 76d18a918e7f9d36e2f5deb20844afae6443d3c5 # Parent f0ee7a16125d62188d1e4f03e8cfb566f25043e7 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 diff -r f0ee7a16125d -r 76d18a918e7f manifests/templates.pp --- a/manifests/templates.pp Wed Apr 20 19:13:24 2022 +0100 +++ b/manifests/templates.pp Wed Apr 20 19:24:53 2022 +0100 @@ -529,9 +529,10 @@ else { fail("No MySQL support for ${operatingsystem}") } + include ::defaultusers::params class { 'website::mysql': - mysqluser => template('defaultusers/mysql-user'), - mysqlpassword => template('defaultusers/mysql-password'), + mysqluser => $::defaultusers::params::mysql_user, + mysqlpassword => $::defaultusers::params::mysql_password, mysqlprefix => $mysqlpackage, mysqlsuffix => $mysqlsuffix, phpsuffix => $php_suffix, @@ -776,7 +777,7 @@ } cron { 'owncloudcron': command => "/usr/local/bin/owncloud-cron", - user => $pim_user, + user => $apache::params::user, minute => '*/15', } } diff -r f0ee7a16125d -r 76d18a918e7f modules/website/manifests/php.pp --- 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' => {