Mercurial > repos > other > Puppet
annotate modules/website/manifests/php.pp @ 422:8421eb25c329
Fix PHP extension loading
CentOS numbers the files, and the Puppet module doesn't
clear out the old values, so we double-loaded.
After deleting, it only puts specific ones back and so we need
to specify more now rather than relying on the installers
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Sat, 08 Oct 2022 20:58:14 +0100 |
parents | 0c627ff3a7c3 |
children | b91e948e8645 |
rev | line source |
---|---|
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
1 class website::php( |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
2 $suffix = '', |
320 | 3 $module = undef, |
69
565b788f7ac1
Allow for specifying extra PHP packages (e.g. to enable Posix)
IBBoard <dev@ibboard.co.uk>
parents:
17
diff
changeset
|
4 $extras = [], |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
5 ) { |
402 | 6 include ::apache::params |
390
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
7 if $osfamily == 'RedHat' { |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
8 # Work around SELinux "denied execmem" warnings from preg_match JITing |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
9 $pcre_jit = 0 |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
10 } |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
11 else { |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
12 $pcre_jit = 1 |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
13 } |
419 | 14 |
15 file { '/run/php/': | |
16 ensure => directory, | |
17 } -> | |
390
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
18 class { '::php': |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
19 ensure => present, |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
20 manage_repos => false, |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
21 fpm => true, |
419 | 22 fpm_service_enable => true, |
23 fpm_service_ensure => 'running', | |
390
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
24 fpm_pools => { |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
25 'www' => { |
400
f354100b688a
Switch to Ubuntu-standard PHP FPM socket dir
IBBoard <dev@ibboard.co.uk>
parents:
399
diff
changeset
|
26 'listen' => '/run/php/php-fpm.sock', |
402 | 27 'listen_owner' => $::apache::params::user, |
28 'listen_group' => $::apache::params::group, | |
390
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
29 'slowlog' => '/var/log/php-fpm/www-slow.log', |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
30 'security_limit_extensions' => ['.php', '.html'], |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
31 'php_admin_value' => { |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
32 'memory_limit' => '256M', |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
33 }, |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
34 'php_value' => { |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
35 # 'session.save_path' => '/var/lib/php/session' # Ubuntu uses plural, CentOS uses singular |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
36 }, |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
37 }, |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
38 }, |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
39 dev => false, |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
40 composer => false, |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
41 pear => false, |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
42 settings => { |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
43 'PHP/default_charset' => 'UTF-8', |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
44 'PHP/pcre.jit' => $pcre_jit, |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
45 # Space isn't scarce these days - increase default sizes |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
46 'PHP/upload_max_filesize' => "8M", |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
47 'PHP/post_max_size' => "8M", |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
48 'Data/date.timezone' => 'UTC', |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
49 }, |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
50 extensions => { |
422 | 51 gd => { |
52 ini_prefix => '20-', | |
53 }, | |
54 iconv => { | |
55 ini_prefix => '20-', | |
56 }, | |
57 mbstring => { | |
58 ini_prefix => '20-', | |
59 }, | |
390
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
60 opcache => { |
422 | 61 ini_prefix => '10-', |
62 zend => true, | |
390
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
63 settings => { |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
64 'opcache.enable' => 1, |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
65 'opcache.enable_cli' => 1, |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
66 'opcache.interned_strings_buffer' => 8, |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
67 'opcache.max_accelerated_files' => 10000, |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
68 'opcache.memory_consumption' => 128, |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
69 'opcache.save_comments' => 1, |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
70 'opcache.revalidate_freq' => 1, |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
71 } |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
72 }, |
422 | 73 xml => { |
74 ini_prefix => '20-', | |
75 }, | |
399
2c6065b5be5e
Switch to config-based PHP extensions
IBBoard <dev@ibboard.co.uk>
parents:
390
diff
changeset
|
76 } + $extras, |
390
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
77 } |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
78 apache::custom_config { "php.conf": |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
79 ensure => present, |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
80 source => "puppet:///modules/website/php.conf" |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
81 } |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
82 class { ['apache::mod::proxy', 'apache::mod::proxy_fcgi']:} |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
83 } |