|
25 | 25 | # [*listen_mode*] |
26 | 26 | # |
27 | 27 | # [*listen_acl_users*] |
28 | | -# When POSIX Access Control Lists are supported you can set them using this option. |
29 | | -# When set, listen.owner and listen.group are ignored. Value is a comma separated |
30 | | -# list of user names. |
| 28 | +# Array. When POSIX Access Control Lists are supported you can set them using |
| 29 | +# this option. When set, listen.owner and listen.group are ignored. Value is |
| 30 | +# an array of user names. |
31 | 31 | # |
32 | 32 | # [*listen_acl_groups*] |
33 | | -# See listen_acl_users. Value is a comma separated list of group names. |
| 33 | +# See listen_acl_users. Value is an array of group names. |
34 | 34 | # |
35 | 35 | # [*user*] |
36 | 36 | # The user that php-fpm should run as |
|
129 | 129 | # '/etc/php5/fpm/pool.d' or '/etc/php-fpm.d' |
130 | 130 | # |
131 | 131 | define php::fpm::pool ( |
132 | | - $ensure = 'present', |
133 | | - $listen = '127.0.0.1:9000', |
134 | | - $listen_backlog = '-1', |
135 | | - $listen_allowed_clients = undef, |
136 | | - $listen_owner = undef, |
137 | | - $listen_group = undef, |
138 | | - $listen_mode = undef, |
139 | | - Optional[String[1]] $listen_acl_users = undef, |
140 | | - Optional[String[1]] $listen_acl_groups = undef, |
141 | | - $user = $php::fpm::config::user, |
142 | | - $group = $php::fpm::config::group, |
143 | | - Optional[String[1]] $apparmor_hat = undef, |
144 | | - $pm = 'dynamic', |
145 | | - $pm_max_children = '50', |
146 | | - $pm_start_servers = '5', |
147 | | - $pm_min_spare_servers = '5', |
148 | | - $pm_max_spare_servers = '35', |
149 | | - $pm_max_requests = '0', |
150 | | - $pm_process_idle_timeout = '10s', |
151 | | - $pm_status_path = undef, |
152 | | - $ping_path = undef, |
153 | | - $ping_response = 'pong', |
154 | | - $access_log = undef, |
155 | | - $access_log_format = '"%R - %u %t \"%m %r\" %s"', |
156 | | - $request_terminate_timeout = '0', |
157 | | - $request_slowlog_timeout = '0', |
158 | | - $security_limit_extensions = undef, |
159 | | - $slowlog = "/var/log/php-fpm/${name}-slow.log", |
160 | | - $template = 'php/fpm/pool.conf.erb', |
161 | | - $rlimit_files = undef, |
162 | | - $rlimit_core = undef, |
163 | | - $chroot = undef, |
164 | | - $chdir = undef, |
165 | | - $catch_workers_output = 'no', |
166 | | - $include = undef, |
167 | | - $env = [], |
168 | | - $env_value = {}, |
169 | | - $clear_env = true, |
170 | | - $options = {}, |
171 | | - $php_value = {}, |
172 | | - $php_flag = {}, |
173 | | - $php_admin_value = {}, |
174 | | - $php_admin_flag = {}, |
175 | | - $php_directives = [], |
176 | | - $root_group = $php::params::root_group, |
177 | | - Optional[Stdlib::Absolutepath] $base_dir = undef, |
| 132 | + $ensure = 'present', |
| 133 | + $listen = '127.0.0.1:9000', |
| 134 | + $listen_backlog = '-1', |
| 135 | + $listen_allowed_clients = undef, |
| 136 | + $listen_owner = undef, |
| 137 | + $listen_group = undef, |
| 138 | + $listen_mode = undef, |
| 139 | + Optional[Array[String[1]]] $listen_acl_users = undef, |
| 140 | + Optional[Array[String[1]]] $listen_acl_groups = undef, |
| 141 | + $user = $php::fpm::config::user, |
| 142 | + $group = $php::fpm::config::group, |
| 143 | + Optional[String[1]] $apparmor_hat = undef, |
| 144 | + $pm = 'dynamic', |
| 145 | + $pm_max_children = '50', |
| 146 | + $pm_start_servers = '5', |
| 147 | + $pm_min_spare_servers = '5', |
| 148 | + $pm_max_spare_servers = '35', |
| 149 | + $pm_max_requests = '0', |
| 150 | + $pm_process_idle_timeout = '10s', |
| 151 | + $pm_status_path = undef, |
| 152 | + $ping_path = undef, |
| 153 | + $ping_response = 'pong', |
| 154 | + $access_log = undef, |
| 155 | + $access_log_format = '"%R - %u %t \"%m %r\" %s"', |
| 156 | + $request_terminate_timeout = '0', |
| 157 | + $request_slowlog_timeout = '0', |
| 158 | + $security_limit_extensions = undef, |
| 159 | + $slowlog = "/var/log/php-fpm/${name}-slow.log", |
| 160 | + $template = 'php/fpm/pool.conf.erb', |
| 161 | + $rlimit_files = undef, |
| 162 | + $rlimit_core = undef, |
| 163 | + $chroot = undef, |
| 164 | + $chdir = undef, |
| 165 | + $catch_workers_output = 'no', |
| 166 | + $include = undef, |
| 167 | + $env = [], |
| 168 | + $env_value = {}, |
| 169 | + $clear_env = true, |
| 170 | + $options = {}, |
| 171 | + $php_value = {}, |
| 172 | + $php_flag = {}, |
| 173 | + $php_admin_value = {}, |
| 174 | + $php_admin_flag = {}, |
| 175 | + $php_directives = [], |
| 176 | + $root_group = $php::params::root_group, |
| 177 | + Optional[Stdlib::Absolutepath] $base_dir = undef, |
178 | 178 | ) { |
179 | 179 | # The base class must be included first because it is used by parameter defaults |
180 | 180 | if ! defined(Class['php']) { |
|
196 | 196 | default => $php::fpm::package, |
197 | 197 | } |
198 | 198 |
|
| 199 | + # 'php-fpm' expects a comma separated list of user names |
| 200 | + if $listen_acl_users { |
| 201 | + $real_listen_acl_users = join(flatten($listen_acl_users).unique, ",") |
| 202 | + } |
| 203 | + |
| 204 | + # 'php-fpm' expects a comma separated list of group names |
| 205 | + if $listen_acl_groups { |
| 206 | + $real_listen_acl_groups = join(flatten($listen_acl_groups).unique, ",") |
| 207 | + } |
| 208 | + |
199 | 209 | $pool_base_dir = pick_default($base_dir, $php::fpm::config::pool_base_dir, $php::params::fpm_pool_dir) |
200 | 210 | if ($ensure == 'absent') { |
201 | 211 | file { "${pool_base_dir}/${pool}.conf": |
|
0 commit comments