Skip to content

Commit c7817ae

Browse files
author
Federico Fapitalle
committed
Optionally disables fpm config validation
This adds the option to enable/disable fpm config file validation.
1 parent 2a6184c commit c7817ae

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

manifests/fpm.pp

+1
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@
6969
$log_owner = $php::log_owner,
7070
$log_group = $php::log_group,
7171
Boolean $pool_purge = $php::pool_purge,
72+
Boolean $disable_configtest = false,
7273
) {
7374

7475
if ! defined(Class['php']) {

manifests/fpm/config.pp

+6-1
Original file line numberDiff line numberDiff line change
@@ -103,13 +103,18 @@
103103
default => $log_group,
104104
}
105105

106+
$validate_cmd = $php::fpm::disable_configtest ? {
107+
true => undef,
108+
default => $php::globals::fpm_checkconf_cmd,
109+
}
110+
106111
file { $config_file:
107112
ensure => file,
108113
content => template('php/fpm/php-fpm.conf.erb'),
109114
owner => root,
110115
group => $root_group,
111116
mode => '0644',
112-
validate_cmd => $php::globals::fpm_checkconf_cmd,
117+
validate_cmd => $validate_cmd,
113118
}
114119

115120
ensure_resource('file', ['/var/run/php-fpm/', '/var/log/php-fpm/'], {

manifests/fpm/pool.pp

+6-1
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,11 @@
190190
notify => Class['::php::fpm::service'],
191191
}
192192
} else {
193+
$validate_cmd = $php::fpm::disable_configtest ? {
194+
true => undef,
195+
default => $php::globals::fpm_checkconf_cmd,
196+
}
197+
193198
file { "${pool_base_dir}/${pool}.conf":
194199
ensure => file,
195200
notify => Class['::php::fpm::service'],
@@ -198,7 +203,7 @@
198203
owner => root,
199204
group => $root_group,
200205
mode => '0640',
201-
validate_cmd => $php::globals::fpm_checkconf_cmd,
206+
validate_cmd => $validate_cmd,
202207
}
203208
}
204209
}

0 commit comments

Comments
 (0)