Skip to content

Commit f186850

Browse files
author
Alexander Schneider
committed
Improve module handling
1 parent b77b2e0 commit f186850

File tree

6 files changed

+67
-17
lines changed

6 files changed

+67
-17
lines changed

Diff for: Modulefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
name 'phpbrew'
2-
version '1.0.0'
2+
version '1.0.1'
33
author 'Jankowfsky AG - Alexander Schneider'
44
description 'Puppet module for phpbrew.'

Diff for: README.md

+53-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,53 @@
1-
Puppet module for phpbrew.
1+
# puppet-phpbrew
2+
3+
Puppet module for phpbrew.
4+
5+
6+
## Usage
7+
8+
class { 'phpdecoder':
9+
$php_version => '5.3',
10+
$type => 'zend',
11+
}
12+
13+
14+
## Configuration
15+
16+
You can additional define apache modules and php conf.d directory:
17+
18+
class { 'phpdecoder':
19+
$php_version => '5.3',
20+
$type => 'zend',
21+
$modules_dir => '/etc/apache2/modules/zgl/',
22+
$php_ini_dir => '/etc/php5/apache2/conf.d/'
23+
}
24+
25+
26+
Default values:
27+
28+
$php_version = '5.3'
29+
$type = 'zend'
30+
$modules_dir = '/etc/apache2/modules/zgl/'
31+
$php_ini_dir = '/etc/php5/apache2/conf.d/'
32+
33+
34+
## License
35+
36+
This program is free software: you can redistribute it and/or modify
37+
it under the terms of the GNU General Public License as published by
38+
the Free Software Foundation, either version 3 of the License, or
39+
(at your option) any later version.
40+
41+
This program is distributed in the hope that it will be useful,
42+
but WITHOUT ANY WARRANTY; without even the implied warranty of
43+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
44+
GNU General Public License for more details.
45+
46+
You should have received a copy of the GNU General Public License
47+
along with this program. If not, see <http://www.gnu.org/licenses/>.
48+
49+
50+
## Copyright
51+
52+
Alexander Schneider - Jankowfsky AG
53+
www.jankowfsky.com

Diff for: manifests/extension.pp

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
}
2727

2828
if ! $php_version {
29-
warning('No version for extension given. Install aborted.')
29+
warning('No php version for extension given. Install aborted.')
3030
} else {
3131
exec { "phpbrew_extension_${extension_name}-${php_version}-${version}":
3232
command => "/root/.phpbrew/install_extension.sh ${php_version} ${extension_name} ${version}",

Diff for: manifests/init.pp

+10-10
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# class { 'phpbrew': }
1313
#
1414
class phpbrew (
15-
$dependencies = undef
15+
1616
) {
1717
case $operatingsystem {
1818
centos, redhat: {
@@ -21,16 +21,16 @@
2121
debian, ubuntu: {
2222
exec { '/usr/bin/apt-get -y update': }
2323

24-
if ! $dependencies {
25-
$neededDependencies = [ 'autoconf', 'automake', 'curl', 'build-essential', 'libxslt1-dev', 're2c', 'libxml2-dev', 'php5-cli', 'libmcrypt-dev' ]
26-
} else {
27-
$neededDependencies = $dependencies
28-
}
24+
$dependencies = [ 'autoconf', 'automake', 'curl', 'build-essential', 'libxslt1-dev', 're2c', 'libxml2-dev', 'php5-cli', 'libmcrypt-dev' ]
2925

30-
package { $neededDependencies:
31-
ensure => 'installed',
32-
require => Exec['/usr/bin/apt-get -y update'],
33-
before => Exec['download phpbrew'],
26+
each($dependencies) |$dependency| {
27+
if ! defined(Package[$dependency]) {
28+
package { $dependency:
29+
ensure => 'installed',
30+
require => Exec['/usr/bin/apt-get -y update'],
31+
before => Exec['download phpbrew'],
32+
}
33+
}
3434
}
3535

3636
exec { '/usr/bin/apt-get -y build-dep php5':

Diff for: manifests/install.pp

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
$version = '',
1919
$default_path = '/opt/phpbrew'
2020
) {
21-
#require phpbrew
21+
require phpbrew
2222

2323
if $version == '' {
2424
$php_version = $title

Diff for: metadata.json

+1-3
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,5 @@
1212
],
1313
"project_page": "http://github.com/GM-Alex/puppet-phpbrew",
1414
"license": "Apache License, Version 2.0",
15-
"checksums": {
16-
},
17-
"name": "phpbrew"
15+
"name": "puppet-phpbrew"
1816
}

0 commit comments

Comments
 (0)