comparison 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
comparison
equal deleted inserted replaced
401:f0ee7a16125d 402:76d18a918e7f
1 class website::php( 1 class website::php(
2 $suffix = '', 2 $suffix = '',
3 $module = undef, 3 $module = undef,
4 $extras = [], 4 $extras = [],
5 ) { 5 ) {
6 include ::apache::params
6 if $osfamily == 'RedHat' { 7 if $osfamily == 'RedHat' {
7 $listener_user = 'apache'
8 $listener_group = 'apache'
9 # Work around SELinux "denied execmem" warnings from preg_match JITing 8 # Work around SELinux "denied execmem" warnings from preg_match JITing
10 $pcre_jit = 0 9 $pcre_jit = 0
11 } 10 }
12 else { 11 else {
13 $listener_user = 'www-data'
14 $listener_group = 'www-data'
15 $pcre_jit = 1 12 $pcre_jit = 1
16 } 13 }
17 class { '::php': 14 class { '::php':
18 ensure => present, 15 ensure => present,
19 manage_repos => false, 16 manage_repos => false,
20 fpm => true, 17 fpm => true,
21 fpm_pools => { 18 fpm_pools => {
22 'www' => { 19 'www' => {
23 'listen_owner' => $listener_user,
24 'listen_group' => $listener_group,
25 'listen' => '/run/php/php-fpm.sock', 20 'listen' => '/run/php/php-fpm.sock',
21 'listen_owner' => $::apache::params::user,
22 'listen_group' => $::apache::params::group,
26 'slowlog' => '/var/log/php-fpm/www-slow.log', 23 'slowlog' => '/var/log/php-fpm/www-slow.log',
27 'security_limit_extensions' => ['.php', '.html'], 24 'security_limit_extensions' => ['.php', '.html'],
28 'php_admin_value' => { 25 'php_admin_value' => {
29 'memory_limit' => '256M', 26 'memory_limit' => '256M',
30 }, 27 },