Mercurial > repos > other > Puppet
annotate modules/website/manifests/php.pp @ 482:d83de9b3a62b default tip
Update hiera.yaml within Puppet config
Forgot that we manage it from here. Now has content to match
new packages
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Fri, 30 Aug 2024 16:10:36 +0100 |
parents | 2c3e745be8d2 |
children |
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 |
480
2c3e745be8d2
Update server defs and own modules to match
IBBoard <dev@ibboard.co.uk>
parents:
462
diff
changeset
|
7 $pcre_jit = 1 |
419 | 8 |
480
2c3e745be8d2
Update server defs and own modules to match
IBBoard <dev@ibboard.co.uk>
parents:
462
diff
changeset
|
9 if $facts["os"]["name"] == 'Ubuntu' { |
454 | 10 # Ubuntu doesn't prefix its ini files as created here |
11 # and has a different way of handling ordering | |
12 $ini_prefix_10 = '' | |
13 $ini_prefix_20 = '' | |
14 } | |
480
2c3e745be8d2
Update server defs and own modules to match
IBBoard <dev@ibboard.co.uk>
parents:
462
diff
changeset
|
15 else { |
2c3e745be8d2
Update server defs and own modules to match
IBBoard <dev@ibboard.co.uk>
parents:
462
diff
changeset
|
16 fail("Unsupported OS: ${facts['os']['name']}") |
2c3e745be8d2
Update server defs and own modules to match
IBBoard <dev@ibboard.co.uk>
parents:
462
diff
changeset
|
17 } |
454 | 18 |
419 | 19 file { '/run/php/': |
20 ensure => directory, | |
21 } -> | |
390
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
22 class { '::php': |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
23 ensure => present, |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
24 manage_repos => false, |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
25 fpm => true, |
419 | 26 fpm_service_enable => true, |
27 fpm_service_ensure => 'running', | |
390
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
28 fpm_pools => { |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
29 'www' => { |
427 | 30 'listen' => '/run/php-fpm.sock', |
402 | 31 'listen_owner' => $::apache::params::user, |
32 'listen_group' => $::apache::params::group, | |
390
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
33 'slowlog' => '/var/log/php-fpm/www-slow.log', |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
34 'security_limit_extensions' => ['.php', '.html'], |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
35 'php_admin_value' => { |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
36 'memory_limit' => '256M', |
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 'php_value' => { |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
39 # '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
|
40 }, |
462 | 41 'pm_start_servers' => 5, |
42 'pm_min_spare_servers' => 5, | |
43 'pm_max_spare_servers' => 10, | |
390
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
44 }, |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
45 }, |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
46 dev => false, |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
47 composer => false, |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
48 pear => false, |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
49 settings => { |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
50 'PHP/default_charset' => 'UTF-8', |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
51 'PHP/pcre.jit' => $pcre_jit, |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
52 # Space isn't scarce these days - increase default sizes |
480
2c3e745be8d2
Update server defs and own modules to match
IBBoard <dev@ibboard.co.uk>
parents:
462
diff
changeset
|
53 # The new module is typed, so we need ints instead of "16M" |
2c3e745be8d2
Update server defs and own modules to match
IBBoard <dev@ibboard.co.uk>
parents:
462
diff
changeset
|
54 'PHP/upload_max_filesize' => 16777216, |
2c3e745be8d2
Update server defs and own modules to match
IBBoard <dev@ibboard.co.uk>
parents:
462
diff
changeset
|
55 'PHP/post_max_size' => 16777216, |
390
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
56 'Data/date.timezone' => 'UTC', |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
57 }, |
436
6293839019d0
Adjust PHP settings for NextCloud
IBBoard <dev@ibboard.co.uk>
parents:
433
diff
changeset
|
58 cli_settings => { |
6293839019d0
Adjust PHP settings for NextCloud
IBBoard <dev@ibboard.co.uk>
parents:
433
diff
changeset
|
59 'apc.enable_cli' => 1 , |
6293839019d0
Adjust PHP settings for NextCloud
IBBoard <dev@ibboard.co.uk>
parents:
433
diff
changeset
|
60 }, |
390
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
61 extensions => { |
425
b91e948e8645
Add another PHP module to fix webmail
IBBoard <dev@ibboard.co.uk>
parents:
422
diff
changeset
|
62 ctype => { |
454 | 63 ini_prefix => $ini_prefix_20, |
425
b91e948e8645
Add another PHP module to fix webmail
IBBoard <dev@ibboard.co.uk>
parents:
422
diff
changeset
|
64 }, |
422 | 65 gd => { |
454 | 66 ini_prefix => $ini_prefix_20, |
422 | 67 }, |
68 iconv => { | |
454 | 69 ini_prefix => $ini_prefix_20, |
422 | 70 }, |
71 mbstring => { | |
454 | 72 ini_prefix => $ini_prefix_20, |
422 | 73 }, |
390
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
74 opcache => { |
444 | 75 ensure => present, |
454 | 76 ini_prefix => $ini_prefix_10, |
422 | 77 zend => true, |
390
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
78 settings => { |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
79 'opcache.enable' => 1, |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
80 'opcache.enable_cli' => 1, |
454 | 81 'opcache.interned_strings_buffer' => 32, |
82 'opcache.max_accelerated_files' => 15000, | |
83 'opcache.max_wasted_percentage' => 3, | |
84 'opcache.memory_consumption' => 256, | |
390
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
85 'opcache.save_comments' => 1, |
436
6293839019d0
Adjust PHP settings for NextCloud
IBBoard <dev@ibboard.co.uk>
parents:
433
diff
changeset
|
86 'opcache.revalidate_freq' => 60, |
454 | 87 'opcache.huge_code_pages' => 0, |
390
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
88 } |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
89 }, |
422 | 90 xml => { |
454 | 91 ini_prefix => $ini_prefix_20, |
422 | 92 }, |
399
2c6065b5be5e
Switch to config-based PHP extensions
IBBoard <dev@ibboard.co.uk>
parents:
390
diff
changeset
|
93 } + $extras, |
390
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
94 } |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
95 apache::custom_config { "php.conf": |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
96 ensure => present, |
433 | 97 source => "puppet:///modules/website/php.conf", |
98 filename => "php.conf", | |
390
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
99 } |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
100 class { ['apache::mod::proxy', 'apache::mod::proxy_fcgi']:} |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
101 } |