Skip to content

Commit

Permalink
Use automatic lookups for fpm class variables
Browse files Browse the repository at this point in the history
Puppet documentation states `unique` ("array merge") behavior
will return a merged array and will fail for hashes. We can
instead rework this lookup function to automatically lookup
the variables as per current best practises.

This change is in line with b188888.

Closes voxpupuli#536.
  • Loading branch information
sigv authored and Mike Newton committed Oct 5, 2020
1 parent 6fa3670 commit 5d8922b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion data/default.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
php::fpm_pools:
php::fpm::pools:
www:
catch_workers_output: 'no'
listen: '127.0.0.1:9000'
Expand Down
6 changes: 3 additions & 3 deletions manifests/fpm.pp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
warning('php::fpm is private')
}

$real_settings = lookup('php::fpm::settings', Hash, {'strategy' => 'deep', 'merge_hash_arrays' => true}, $settings)
$real_settings = $settings

# On FreeBSD fpm is not a separate package, but included in the 'php' package.
# Implies that the option SET+=FPM was set when building the port.
Expand Down Expand Up @@ -99,8 +99,8 @@

Class['php::fpm::config'] ~> Class['php::fpm::service']

$real_global_pool_settings = lookup('php::fpm::global_pool_settings', Hash, {'strategy' => 'unique'}, $global_pool_settings)
$real_pools = lookup('php::fpm::pools', Hash, {'strategy' => 'unique'}, $pools)
$real_global_pool_settings = $global_pool_settings
$real_pools = $pools
create_resources(::php::fpm::pool, $real_pools, $real_global_pool_settings)

# Create an override to use a reload signal as trusty and utopic's
Expand Down

0 comments on commit 5d8922b

Please sign in to comment.