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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
|
# File 'manifests/pear.pp', line 1
define php::pear(
$modulename = $name,
$dependencies = undef,
$logdir = '/var/log/puppet',
$enablefile = undef,
$manage_ini = true,
) {
Exec {
path => '/usr/sbin:/usr/bin:/sbin:/bin',
}
include ::php
if($dependencies!=undef)
{
validate_array($dependencies)
package { $dependencies:
ensure => 'installed',
before => Exec["pear install ${modulename}"],
}
}
# if($php::params::pecl_dependencies!=undef)
# {
# if(!defined(Package[$php::params::pecl_dependencies]))
# {
# package { $php::params::pecl_dependencies:
# ensure => 'installed',
# before => Exec["pear install ${modulename}"],
# }
# }
# }
exec { "pear ${modulename} pkg-config":
command => 'which pkg-config',
unless => 'which pkg-config',
}
exec { "pear install ${modulename}":
command => "bash -c 'yes \$'\\n' | pear install ${modulename}'",
unless => "pear list | grep -E \'\\b${modulename}\\b\'",
require => Exec["pear ${modulename} pkg-config"],
}
if($manage_ini)
{
file { "${php::params::confbase}/mods-available/${modulename}.ini":
ensure => present,
owner => 'root',
group => 'root',
mode => '0644',
content => "extension=${modulename}.so\n",
require => Exec["pear install ${modulename}"],
}
}
if($enablefile)
{
file { $enablefile:
ensure => 'link',
target => "${php::params::confbase}/mods-available/${modulename}.ini",
}
}
}
|