Skip to content

Commit

Permalink
Optionally disables fpm config validation
Browse files Browse the repository at this point in the history
This adds the option to enable/disable fpm config file validation.
  • Loading branch information
Federico Fapitalle committed Jun 19, 2020
1 parent 2a6184c commit c7817ae
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
1 change: 1 addition & 0 deletions manifests/fpm.pp
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
$log_owner = $php::log_owner,
$log_group = $php::log_group,
Boolean $pool_purge = $php::pool_purge,
Boolean $disable_configtest = false,
) {

if ! defined(Class['php']) {
Expand Down
7 changes: 6 additions & 1 deletion manifests/fpm/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,18 @@
default => $log_group,
}

$validate_cmd = $php::fpm::disable_configtest ? {
true => undef,
default => $php::globals::fpm_checkconf_cmd,
}

file { $config_file:
ensure => file,
content => template('php/fpm/php-fpm.conf.erb'),
owner => root,
group => $root_group,
mode => '0644',
validate_cmd => $php::globals::fpm_checkconf_cmd,
validate_cmd => $validate_cmd,
}

ensure_resource('file', ['/var/run/php-fpm/', '/var/log/php-fpm/'], {
Expand Down
7 changes: 6 additions & 1 deletion manifests/fpm/pool.pp
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,11 @@
notify => Class['::php::fpm::service'],
}
} else {
$validate_cmd = $php::fpm::disable_configtest ? {
true => undef,
default => $php::globals::fpm_checkconf_cmd,
}

file { "${pool_base_dir}/${pool}.conf":
ensure => file,
notify => Class['::php::fpm::service'],
Expand All @@ -198,7 +203,7 @@
owner => root,
group => $root_group,
mode => '0640',
validate_cmd => $php::globals::fpm_checkconf_cmd,
validate_cmd => $validate_cmd,
}
}
}

0 comments on commit c7817ae

Please sign in to comment.