Skip to content

Commit 3c66d69

Browse files
authored
Merge pull request #522 from comport3/master
Fix deprecated Hiera lookup warnings. Add default www pool in YAML.
2 parents 9fb2fd5 + b21dad9 commit 3c66d69

7 files changed

Lines changed: 32 additions & 9 deletions

File tree

data/default.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
php::fpm_pools:
3+
www:
4+
catch_workers_output: 'no'
5+
listen: '127.0.0.1:9000'
6+
listen_backlog: '-1'
7+
pm: dynamic
8+
pm_max_children: 50
9+
pm_max_requests: 0
10+
pm_max_spare_servers: 35
11+
pm_min_spare_servers: 5
12+
pm_start_servers: 5
13+
request_terminate_timeout: 0

hiera.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
version: 5
3+
hierarchy:
4+
- name: default.yaml
5+
paths:
6+
- 'default.yaml'

manifests/apache_config.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
assert_private()
1717

18-
$real_settings = deep_merge($settings, hiera_hash('php::apache::settings', {}))
18+
$real_settings = $real_settings = lookup('php::apache::settings', Hash, {'strategy' => 'deep', 'merge_hash_arrays' => true}, $settings)
1919

2020
php::config { 'apache':
2121
file => $inifile,

manifests/cli.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
}
3434
}
3535

36-
$real_settings = deep_merge($settings, hiera_hash('php::cli::settings', {}))
36+
$real_settings = lookup('php::cli::settings', Hash, {'strategy' => 'deep', 'merge_hash_arrays' => true}, $settings)
3737

3838
if $inifile != $php::params::config_root_inifile {
3939
# only create a cli specific inifile if the filenames are different

manifests/embedded.pp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,13 @@
2323

2424
assert_private()
2525

26-
$real_settings = deep_merge(
27-
$settings,
28-
hiera_hash('php::embedded::settings', {})
26+
$real_settings = lookup(
27+
'php::embedded::settings',
28+
Hash, {
29+
'strategy' => 'deep',
30+
'merge_hash_arrays' => true
31+
},
32+
$settings
2933
)
3034

3135
$real_package = $facts['os']['family'] ? {

manifests/fpm.pp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
warning('php::fpm is private')
7171
}
7272

73-
$real_settings = deep_merge($settings, hiera_hash('php::fpm::settings', {}))
73+
$real_settings = lookup('php::fpm::settings', Hash, {'strategy' => 'deep', 'merge_hash_arrays' => true}, $settings)
7474

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

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

102-
$real_global_pool_settings = hiera_hash('php::fpm::global_pool_settings', $global_pool_settings)
103-
$real_pools = hiera_hash('php::fpm::pools', $pools)
102+
$real_global_pool_settings = lookup('php::fpm::global_pool_settings', Hash, {'strategy' => 'unique'}, $global_pool_settings)
103+
$real_pools = lookup('php::fpm::pools', Hash, {'strategy' => 'unique'}, $pools)
104104
create_resources(::php::fpm::pool, $real_pools, $real_global_pool_settings)
105105

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

manifests/init.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@
131131
$fpm_service_ensure = $php::params::fpm_service_ensure,
132132
$fpm_service_name = $php::params::fpm_service_name,
133133
$fpm_service_provider = undef,
134-
Hash $fpm_pools = { 'www' => {} },
134+
Hash $fpm_pools = {},
135135
Hash $fpm_global_pool_settings = {},
136136
$fpm_inifile = $php::params::fpm_inifile,
137137
$fpm_package = undef,

0 commit comments

Comments
 (0)