Skip to content

Commit f4be611

Browse files
author
Goran Miskovic
committed
Added support for installing deb packages.
1 parent 53c1bad commit f4be611

File tree

2 files changed

+57
-5
lines changed

2 files changed

+57
-5
lines changed

README.md

+14-3
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,16 @@ package { 'igbinary':
8181
}
8282
```
8383

84+
#### deb package example
85+
86+
```
87+
package { "libgearman":
88+
ensure => "latest",
89+
provider => "dpkg",
90+
source => "/path/to/libgearman8_1.1.7-1_amd64.deb",
91+
}
92+
```
93+
8494
### Installing packages
8595

8696
It's quite simple to install packages not included in the package, simply use `php::extension`
@@ -89,14 +99,14 @@ It's quite simple to install packages not included in the package, simply use `p
8999
php::extension { 'platform-independent-name':
90100
ensure => $ensure, # Same as Package { ensure }
91101
package => $package, # Package name as defined in the package provider
92-
provider => $provider; # Provider used to install (pecl, pearl, (default)undef)
102+
provider => $provider; # Provider used to install (pecl, pear, (default)undef)
93103
}
94104
95105
# same as
96106
97107
package { $package: # Package name as defined in the package provider
98108
ensure => $ensure, # Same as Package { ensure }
99-
provider => $provider; # Provider used to install (pecl, pearl, (default)undef)
109+
provider => $provider; # Provider used to install (pecl, pear, (default)undef)
100110
}
101111
```
102112

@@ -140,7 +150,8 @@ augeas { "php-${uniqie-name}-config":
140150
}
141151
142152
# or to modify php.ini
143-
# note that keys outside of the sections in php.ini file should be referenced by PHP and not .anon
153+
# note that keys outside of the sections in php.ini file
154+
# should be referenced by PHP and not .anon
144155
145156
php::config { '$unique-name':
146157
inifile => '$full_path_to_php.ini_file',

manifests/extension.pp

+43-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,24 @@
44
#
55
# === Parameters
66
#
7-
# No parameters
7+
# [*ensure*]
8+
# The ensure of the package to install
9+
# Could be "latest", "installed" or a pinned version
10+
#
11+
# [*package*]
12+
# Package name as defined in the package provider
13+
#
14+
# [*provider*]
15+
# The provider used to install the package
16+
# Could be "pecl", "apt", "dpkg" or any other OS package provider
17+
#
18+
# [*pipe*]
19+
# Used to answer interactive questions from pecl
20+
# Some extensions require answers on different questions. To provide answers
21+
# supply a list of lines with answers - one answer per line
22+
#
23+
# [*source*]
24+
# The path to the deb package to install
825
#
926
# === Variables
1027
#
@@ -15,6 +32,23 @@
1532
#
1633
# php::extension { "apc": }
1734
#
35+
# $answers = "shared
36+
# /usr
37+
# all"
38+
# php::extension { 'libenchant':
39+
# ensure => "latest",
40+
# package => "enchant",
41+
# provider => "pecl",
42+
# pipe => $answers;
43+
# }
44+
#
45+
# php::extension { 'gearman':
46+
# ensure => "latest",
47+
# package => "libgearman8",
48+
# provider => "dpkg",
49+
# source => "/path/to/libgearman8_1.1.7-1_amd64.deb";
50+
# }
51+
#
1852
# === Authors
1953
#
2054
# Christian "Jippi" Winther <[email protected]>
@@ -27,7 +61,8 @@
2761
$ensure,
2862
$package,
2963
$provider,
30-
$pipe = undef
64+
$pipe = undef,
65+
$source = undef
3166
) {
3267

3368
if $provider == 'pecl' {
@@ -36,6 +71,12 @@
3671
provider => $provider,
3772
pipe => $pipe;
3873
}
74+
} elsif $provider == 'dpkg' {
75+
package { $package:
76+
ensure => $ensure,
77+
provider => $provider,
78+
source => $source;
79+
}
3980
} else {
4081
package { $package:
4182
ensure => $ensure,

0 commit comments

Comments
 (0)