From 5d8922b577593701bad57e254e6e02040cd6e5b0 Mon Sep 17 00:00:00 2001 From: Valters Jansons Date: Tue, 22 Oct 2019 18:12:33 +0300 Subject: [PATCH] Use automatic lookups for `fpm` class variables 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 b1888888ce255460fac311c48706033a56194e81. Closes #536. --- data/default.yaml | 2 +- manifests/fpm.pp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/data/default.yaml b/data/default.yaml index a48a7b48..e63e4a26 100644 --- a/data/default.yaml +++ b/data/default.yaml @@ -1,5 +1,5 @@ --- -php::fpm_pools: +php::fpm::pools: www: catch_workers_output: 'no' listen: '127.0.0.1:9000' diff --git a/manifests/fpm.pp b/manifests/fpm.pp index a74dcc53..f6b57f0c 100644 --- a/manifests/fpm.pp +++ b/manifests/fpm.pp @@ -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. @@ -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