Mercurial > repos > other > Puppet
view 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 |
line wrap: on
line source
class website::php( $suffix = '', $module = undef, $extras = [], ) { include ::apache::params if $osfamily == 'RedHat' { # Work around SELinux "denied execmem" warnings from preg_match JITing $pcre_jit = 0 } else { $pcre_jit = 1 } class { '::php': ensure => present, manage_repos => false, fpm => true, fpm_pools => { 'www' => { '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' => { 'memory_limit' => '256M', }, 'php_value' => { # 'session.save_path' => '/var/lib/php/session' # Ubuntu uses plural, CentOS uses singular }, }, }, dev => false, composer => false, pear => false, settings => { 'PHP/default_charset' => 'UTF-8', 'PHP/pcre.jit' => $pcre_jit, # Space isn't scarce these days - increase default sizes 'PHP/upload_max_filesize' => "8M", 'PHP/post_max_size' => "8M", 'Data/date.timezone' => 'UTC', }, extensions => { gd => {}, mbstring => {}, opcache => { settings => { 'zend_extension' => 'opcache.so', 'opcache.enable' => 1, 'opcache.enable_cli' => 1, 'opcache.interned_strings_buffer' => 8, 'opcache.max_accelerated_files' => 10000, 'opcache.memory_consumption' => 128, 'opcache.save_comments' => 1, 'opcache.revalidate_freq' => 1, } }, xml => {}, } + $extras, } apache::custom_config { "php.conf": ensure => present, source => "puppet:///modules/website/php.conf" } class { ['apache::mod::proxy', 'apache::mod::proxy_fcgi']:} }