Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change datatype of listen.? parameters from String[1] to Array[String[1]] #621

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions manifests/fpm/pool.pp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@
#
# [*listen_mode*]
#
# [*listen_acl_users*]
# Array. When POSIX Access Control Lists are supported you can set them using
# this option. When set, listen.owner and listen.group are ignored. Value is
# an array of user names.
#
# [*listen_acl_groups*]
# See listen_acl_users. Value is an array of group names.
#
# [*user*]
# The user that php-fpm should run as
#
Expand Down Expand Up @@ -128,6 +136,8 @@
$listen_owner = undef,
$listen_group = undef,
$listen_mode = undef,
Array[String[1]] $listen_acl_users = undef,
Array[String[1]] $listen_acl_groups = undef,
$user = $php::fpm::config::user,
$group = $php::fpm::config::group,
Optional[String[1]] $apparmor_hat = undef,
Expand Down Expand Up @@ -186,6 +196,16 @@
default => $php::fpm::package,
}

# 'php-fpm' expects a comma separated list of user names
unless $listen_acl_users.empty {
$real_listen_acl_users = join(flatten($listen_acl_users).unique, ",")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$real_listen_acl_users = join(flatten($listen_acl_users).unique, ",")
$real_listen_acl_users = join(flatten($listen_acl_users).unique, ',')

}

# 'php-fpm' expects a comma separated list of group names
unless $listen_acl_groups.empty {
$real_listen_acl_groups = join(flatten($listen_acl_groups).unique, ",")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$real_listen_acl_groups = join(flatten($listen_acl_groups).unique, ",")
$real_listen_acl_groups = join(flatten($listen_acl_groups).unique, ',')

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

otherwise puppet-lint complains :)

}

$pool_base_dir = pick_default($base_dir, $php::fpm::config::pool_base_dir, $php::params::fpm_pool_dir)
if ($ensure == 'absent') {
file { "${pool_base_dir}/${pool}.conf":
Expand Down
6 changes: 6 additions & 0 deletions templates/fpm/pool.conf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ listen.mode = <%= @listen_mode %>
<% else -%>
;listen.mode = 0660
<% end -%>
<% if @real_listen_acl_users -%>
listen.acl_users = <%= @real_listen_acl_users %>
<% end -%>
<% if @real_listen_acl_groups -%>
listen.acl_groups = <%= @real_listen_acl_groups %>
<% end -%>

; Unix user/group of processes
; Note: The user is mandatory. If the group is not set, the default user's group
Expand Down