Mercurial > repos > other > Puppet
annotate modules/website/manifests/php.pp @ 321:cd1bcc06f09c
Actually install extra PHP packages
Previously we were passing them and doing NOTHING with them!
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Sun, 01 Mar 2020 10:58:46 +0000 |
parents | 99e3ca448d55 |
children | 0d263bcbbfe9 |
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, |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
4 $opcache = undef, |
69
565b788f7ac1
Allow for specifying extra PHP packages (e.g. to enable Posix)
IBBoard <dev@ibboard.co.uk>
parents:
17
diff
changeset
|
5 $extras = [], |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
6 ) { |
246 | 7 Package <| tag == 'php-package' |> -> File <| tag == 'php-file' |> ~> Service['httpd'] |
69
565b788f7ac1
Allow for specifying extra PHP packages (e.g. to enable Posix)
IBBoard <dev@ibboard.co.uk>
parents:
17
diff
changeset
|
8 |
320 | 9 if $module != undef { |
10 $php_core = 'php' | |
11 package { $php_core: | |
12 provider => 'dnfmodule', | |
13 ensure => $module, | |
14 tag => 'php-package', | |
15 } | |
179
89cd717361fd
Swap to PHP 7.2, since 7.0 is EOL now
IBBoard <dev@ibboard.co.uk>
parents:
169
diff
changeset
|
16 } else { |
320 | 17 if $suffix =~ /^7[1-9]w$/ { |
18 $php_core = "mod_php${suffix}" | |
19 } else { | |
20 $php_core = "php${suffix}" | |
21 } | |
22 package { $php_core: | |
23 ensure => installed, | |
24 tag => 'php-package', | |
25 } | |
179
89cd717361fd
Swap to PHP 7.2, since 7.0 is EOL now
IBBoard <dev@ibboard.co.uk>
parents:
169
diff
changeset
|
26 } |
89cd717361fd
Swap to PHP 7.2, since 7.0 is EOL now
IBBoard <dev@ibboard.co.uk>
parents:
169
diff
changeset
|
27 |
320 | 28 $packages = [ "php${suffix}-mbstring", "php${suffix}-xml", "php${suffix}-gd" ] |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
29 package { $packages: |
131
0dd899a10ee1
Change all "latest" packages to "installed"
IBBoard <dev@ibboard.co.uk>
parents:
120
diff
changeset
|
30 ensure => installed, |
246 | 31 tag => 'php-package', |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
32 } |
321
cd1bcc06f09c
Actually install extra PHP packages
IBBoard <dev@ibboard.co.uk>
parents:
320
diff
changeset
|
33 website::php::extra { $extras: } |
246 | 34 |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
35 file { '/etc/php.d/custom-lockdown.ini': |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
36 ensure => present, |
106
ef0926ee389a
Lock down Apache headers for security, based on https://securityheaders.io/
IBBoard <dev@ibboard.co.uk>
parents:
94
diff
changeset
|
37 content => 'allow_url_fopen = \'off\' |
ef0926ee389a
Lock down Apache headers for security, based on https://securityheaders.io/
IBBoard <dev@ibboard.co.uk>
parents:
94
diff
changeset
|
38 expose_php = Off', |
246 | 39 tag => 'php-file', |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
40 } |
17
5ba2ddf53c29
Make sure we specify a default charset (even thought it defaults to UTF-8) because ownCloud complains
IBBoard <dev@ibboard.co.uk>
parents:
3
diff
changeset
|
41 file { '/etc/php.d/custom-php.ini': |
5ba2ddf53c29
Make sure we specify a default charset (even thought it defaults to UTF-8) because ownCloud complains
IBBoard <dev@ibboard.co.uk>
parents:
3
diff
changeset
|
42 ensure => present, |
120
b00eb9434938
Disable PCRE JIT to stop SELinux giving "denied execmem" for Apache
IBBoard <dev@ibboard.co.uk>
parents:
106
diff
changeset
|
43 source => 'puppet:///modules/website/custom-php.ini', |
246 | 44 tag => 'php-file', |
17
5ba2ddf53c29
Make sure we specify a default charset (even thought it defaults to UTF-8) because ownCloud complains
IBBoard <dev@ibboard.co.uk>
parents:
3
diff
changeset
|
45 } |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
46 |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
47 if $opcache { |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
48 package { "php${suffix}-${opcache}": |
131
0dd899a10ee1
Change all "latest" packages to "installed"
IBBoard <dev@ibboard.co.uk>
parents:
120
diff
changeset
|
49 ensure => installed, |
179
89cd717361fd
Swap to PHP 7.2, since 7.0 is EOL now
IBBoard <dev@ibboard.co.uk>
parents:
169
diff
changeset
|
50 require => Package[$php_core], |
246 | 51 tag => 'php-package', |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
52 } |
240
960e737a120e
Deduplicate PHP opcache config files
IBBoard <dev@ibboard.co.uk>
parents:
179
diff
changeset
|
53 # Use Remi's (and the OS's) naming convention |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
54 file { '/etc/php.d/opcache.ini': |
240
960e737a120e
Deduplicate PHP opcache config files
IBBoard <dev@ibboard.co.uk>
parents:
179
diff
changeset
|
55 ensure => absent, |
960e737a120e
Deduplicate PHP opcache config files
IBBoard <dev@ibboard.co.uk>
parents:
179
diff
changeset
|
56 } |
960e737a120e
Deduplicate PHP opcache config files
IBBoard <dev@ibboard.co.uk>
parents:
179
diff
changeset
|
57 file { '/etc/php.d/10-opcache.ini': |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
58 ensure => present, |
169
4efaba4fbe94
Expand PHP OpCache config in line with NextCloud recommendations
IBBoard <dev@ibboard.co.uk>
parents:
149
diff
changeset
|
59 source => 'puppet:///modules/website/opcache.ini', |
246 | 60 tag => 'php-file', |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
61 } |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
62 } |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
63 } |