forked from bigcommerce/puppet-php
-
Notifications
You must be signed in to change notification settings - Fork 0
/
embedded.pp
51 lines (45 loc) · 1.06 KB
/
embedded.pp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# Install and configure php embedded SAPI
#
# === Parameters
#
# [*inifile*]
# The path to the ini php5-embeded ini file
#
# [*settings*]
# Hash with nested hash of key => value to set in inifile
#
# [*package*]
# Specify which package to install
#
# [*ensure*]
# Specify which version of the package to install
#
class php::embedded(
$ensure = $::php::ensure,
$package =
"${::php::package_prefix}${::php::params::embedded_package_suffix}",
$inifile = $::php::params::embedded_inifile,
$settings = {},
) inherits ::php::params {
if $caller_module_name != $module_name {
warning('php::embedded is private')
}
validate_absolute_path($inifile)
validate_hash($settings)
$real_settings = deep_merge(
$settings,
hiera_hash('php::embedded::settings', {})
)
$real_package = $::osfamily ? {
'Debian' => "lib${package}",
default => $package,
}
package { $real_package:
ensure => $ensure,
require => Class['::php::packages'],
}->
::php::config { 'embedded':
file => $inifile,
config => $real_settings,
}
}