Skip to content

Commit f5911e7

Browse files
committed
Add loglevel parameter
1 parent f3997cb commit f5911e7

File tree

8 files changed

+102
-50
lines changed

8 files changed

+102
-50
lines changed

Modulefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ dependency 'puppetlabs/apt','>=1.0.0'
1414
dependency 'example42/php','>=2.0.17'
1515
dependency 'example42/puppi','>=1.0.0'
1616

17-
version '1.0.60'
17+
version '1.0.61'

README.markdown

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
compat_sys_deps=>false,
1616
zephir_build=>false,
1717
ini_file=>'phalcon.ini',
18-
debug=>false
18+
debug=>false,
19+
loglevel=>'warning'
1920
}
2021

2122
### Gittip: ###
@@ -34,6 +35,7 @@
3435
zephir_build
3536
ini_file
3637
debug
38+
loglevel
3739

3840
### Prerequisites: ###
3941

manifests/deps/devtools.pp

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,27 @@
33
# Parameters:
44
# [*version*] - desired devtools version - See https://github.com/phalcon/phalcon-devtools/branches for valid branch names
55
class phalconphp::deps::devtools (
6-
$version = '1.3.x',
7-
$debug = false) {
6+
$version = '1.3.x',
7+
$debug = false,
8+
$loglevel = 'warning') {
89
exec { 'git-clone-devtools':
910
command => "sudo git clone https://github.com/phalcon/phalcon-devtools.git -b ${version}",
1011
cwd => "/usr/share/php",
1112
unless => "test -d ./phalcon-devtools",
1213
require => [
1314
Package['php'],
1415
Class['phalconphp::deps::sys']],
15-
logoutput => $debug
16+
logoutput => $debug,
17+
loglevel => $loglevel
1618
}
1719

1820
exec { 'git-pull-devtools':
1921
command => "sudo git pull",
2022
cwd => "/usr/share/php/phalcon-devtools",
2123
onlyif => "sudo test -d ./phalcon-devtools",
2224
require => [Exec['git-clone-devtools']],
23-
logoutput => $debug
25+
logoutput => $debug,
26+
loglevel => $loglevel
2427
}
2528

2629
file { '/usr/bin/phalcon':
@@ -30,22 +33,24 @@
3033
require => [
3134
Class['phalconphp::framework'],
3235
Exec['git-pull-devtools']],
33-
loglevel => 'notice'
36+
loglevel => $loglevel
3437
}
3538

3639
file { '/usr/share/php/phalcon-devtools':
37-
ensure => directory,
38-
recurse => true,
39-
owner => 'www-data',
40-
group => 'www-data',
41-
require => [Exec['git-pull-devtools']]
40+
ensure => directory,
41+
recurse => true,
42+
owner => 'www-data',
43+
group => 'www-data',
44+
require => [Exec['git-pull-devtools']],
45+
loglevel => $loglevel
4246
}
4347

4448
exec { 'chmod+x-devtools':
4549
command => 'chmod ugo+x /usr/bin/phalcon',
4650
require => [
4751
File['/usr/share/php/phalcon-devtools'],
4852
File['/usr/bin/phalcon']],
49-
logoutput => $debug
53+
logoutput => $debug,
54+
loglevel => $loglevel
5055
}
5156
}

manifests/deps/jsonc.pp

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,52 +2,61 @@
22
# Installs json-c (https://github.com/json-c/json-c)
33

44
class phalconphp::deps::jsonc (
5-
$debug = false) {
5+
$debug = false,
6+
$loglevel = 'warning') {
67
include phalconphp::deps::sys
78

89
exec { 'git-clone-json-c':
910
command => 'git clone https://github.com/json-c/json-c.git',
1011
cwd => '/tmp',
1112
unless => 'test -d /tmp/json-c',
13+
require => [Class['phalconphp::deps::sys']],
1214
logoutput => $debug,
13-
require => [Class['phalconphp::deps::sys']]
15+
loglevel => $loglevel
1416
} ->
1517
exec { 'git-pull-json-c':
1618
command => 'git pull',
1719
cwd => '/tmp/json-c',
1820
onlyif => 'test -d /tmp/json-c',
1921
require => [Exec['git-clone-json-c']],
20-
logoutput => $debug
22+
logoutput => $debug,
23+
loglevel => $loglevel
2124
} ->
2225
exec { 'autogen-json-c':
2326
command => 'sh ./autogen.sh',
2427
cwd => '/tmp/json-c',
25-
logoutput => $debug,
2628
require => [Exec['git-pull-json-c']],
29+
logoutput => $debug,
30+
loglevel => $loglevel
2731
} ->
2832
exec { 'configure-json-c':
2933
command => '/tmp/json-c/configure',
3034
cwd => '/tmp/json-c',
3135
onlyif => 'test -f /tmp/json-c/configure',
3236
require => [Exec['autogen-json-c']],
33-
logoutput => $debug
37+
logoutput => $debug,
38+
loglevel => $loglevel
3439
} ->
3540
exec { 'make-json-c':
3641
command => "make -j${::processorcount}",
3742
cwd => '/tmp/json-c',
3843
require => [Exec['configure-json-c']],
39-
logoutput => true
44+
logoutput => $debug,
45+
loglevel => $loglevel
4046
} ->
4147
exec { 'install-json-c':
4248
command => "sudo make -j${::processorcount} install",
4349
cwd => '/tmp/json-c',
50+
require => [Exec['make-json-c']],
4451
logoutput => $debug,
45-
require => [Exec['make-json-c']]
52+
loglevel => $loglevel
4653
} ->
4754
exec { 'remove-json-c-source':
48-
cwd => '/tmp',
49-
command => 'rm ./json-c -R -f',
50-
onlyif => 'test -d /tmp/json-c',
51-
require => [Exec['install-json-c']]
55+
cwd => '/tmp',
56+
command => 'rm ./json-c -R -f',
57+
onlyif => 'test -d /tmp/json-c',
58+
require => [Exec['install-json-c']],
59+
logoutput => $debug,
60+
loglevel => $loglevel
5261
}
5362
}

manifests/deps/sys.pp

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# Class: phalconphp::deps::sys
22
# Installs gcc, make, automake, autoconf, re2c, pcre, pcre-devel, libcurl, libcurl-devel, wget
33
class phalconphp::deps::sys (
4-
$each_compat = false) {
4+
$each_compat = false,
5+
$loglevel = 'warning') {
56
case $::osfamily {
67
'RedHat' : { # Define the package names for rhel
78
case $::operatingsystem {
@@ -55,11 +56,17 @@
5556
}
5657

5758
if $each_compat == true {
58-
package { $phalcon_deps: ensure => present }
59+
package { $phalcon_deps:
60+
ensure => present,
61+
loglevel => $loglevel
62+
}
5963
} else {
6064
each($phalcon_deps) |$phalcon_dep| {
6165
if defined(Package[$phalcon_dep]) == false {
62-
package { $phalcon_dep: ensure => present }
66+
package { $phalcon_dep:
67+
ensure => present,
68+
loglevel => $loglevel
69+
}
6370
}
6471
}
6572
}

manifests/deps/zephir.pp

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,39 @@
11
# Class: phalconphp::deps::zephir
22
# Installs Zephir (http://zephir-lang.com/)
33
class phalconphp::deps::zephir (
4-
$debug = false) {
5-
class { 'phalconphp::deps::jsonc': debug => $debug }
4+
$debug = false,
5+
$loglevel = 'warning') {
6+
class { 'phalconphp::deps::jsonc':
7+
debug => $debug,
8+
loglevel => $loglevel
9+
}
610

711
exec { 'git-clone-zephir':
812
command => 'git clone https://github.com/phalcon/zephir.git',
913
cwd => '/tmp',
1014
unless => 'test -d /tmp/zephir',
1115
require => [Class['phalconphp::deps::sys']],
12-
logoutput => $debug
16+
logoutput => $debug,
17+
loglevel => $loglevel
1318
} ->
1419
exec { 'git-pull-zephir':
1520
command => 'git pull',
1621
cwd => '/tmp/zephir',
1722
onlyif => 'test -d /tmp/zephir',
18-
logoutput => $debug
23+
logoutput => $debug,
24+
loglevel => $loglevel
1925
} ->
2026
exec { 'install-zephir':
2127
command => './install -c',
2228
cwd => '/tmp/zephir',
2329
require => [Class['phalconphp::deps::jsonc']],
2430
logoutput => $debug,
31+
loglevel => $loglevel
2532
} ->
2633
exec { 'check-zephir':
2734
command => 'zephir version',
2835
logoutput => $debug,
29-
require => [Exec['install-zephir']]
36+
require => [Exec['install-zephir']],
37+
loglevel => $loglevel
3038
}
3139
}

manifests/framework.pp

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,29 @@
44
$version,
55
$zephir_build = false,
66
$ini_file = "phalcon.ini",
7-
$debug = false) {
7+
$debug = false,
8+
$loglevel = 'warning') {
89
exec { 'git-clone-phalcon':
910
command => "git clone -b ${version} https://github.com/phalcon/cphalcon.git",
1011
cwd => '/tmp',
1112
require => [Class['phalconphp::deps::sys']],
1213
unless => 'test -d /tmp/cphalcon',
13-
logoutput => $debug
14+
logoutput => $debug,
15+
loglevel => $loglevel
1416
} ->
1517
exec { 'git-pull-phalcon':
1618
command => 'git pull',
1719
cwd => '/tmp/cphalcon',
1820
onlyif => 'test -d /tmp/cphalcon',
1921
require => [Exec['git-clone-phalcon']],
20-
logoutput => $debug
22+
logoutput => $debug,
23+
loglevel => $loglevel
2124
}
2225

2326
file { "${php::config_dir}/${ini_file}":
2427
ensure => file,
2528
require => [Class['php']],
26-
loglevel => 'notice'
29+
loglevel => $loglevel
2730
}
2831

2932
if $version == '2.0.0' or $version == 'dev' {
@@ -35,30 +38,34 @@
3538
Class['phalconphp::deps::zephir'],
3639
Exec['git-pull-phalcon']],
3740
onlyif => 'test -f /tmp/cphalcon/config.json',
38-
logoutput => $debug
41+
logoutput => $debug,
42+
loglevel => $loglevel
3943
}
4044

4145
exec { 'install-phalcon-2.0':
4246
command => 'zephir build',
4347
cwd => '/tmp/cphalcon',
4448
require => [Exec['generate-phalcon-2.0']],
45-
logoutput => $debug
49+
logoutput => $debug,
50+
loglevel => $loglevel
4651
}
4752
} else {
4853
exec { 'install-phalcon-2.0':
4954
command => "/tmp/cphalcon/ext/install-test",
5055
cwd => '/tmp/cphalcon/ext',
5156
require => [Exec['git-pull-phalcon']],
5257
onlyif => 'test -f /tmp/cphalcon/ext/install-test',
53-
logoutput => $debug
58+
logoutput => $debug,
59+
loglevel => $loglevel
5460
}
5561
}
5662

5763
exec { 'remove-phalcon-src-2.0':
5864
cwd => '/tmp',
5965
command => 'rm ./cphalcon -R -f',
6066
require => [Exec['install-phalcon-2.0']],
61-
logoutput => $debug
67+
logoutput => $debug,
68+
loglevel => $loglevel
6269
}
6370

6471
php::augeas { 'php-load-phalcon-2.0':
@@ -68,15 +75,16 @@
6875
require => [
6976
File["${php::config_dir}/${ini_file}"],
7077
Exec['remove-phalcon-src-2.0']],
71-
loglevel => 'notice'
78+
loglevel => $loglevel
7279
}
7380
} else {
7481
exec { 'install-phalcon-1.x':
7582
command => 'sudo ./install',
7683
cwd => '/tmp/cphalcon/build',
7784
onlyif => 'test -f /tmp/cphalcon/build/install',
7885
require => [Exec['git-pull-phalcon']],
79-
logoutput => $debug
86+
logoutput => $debug,
87+
loglevel => $loglevel
8088
}
8189

8290
exec { 'remove-phalcon-src-1.x':
@@ -85,7 +93,8 @@
8593
require => [
8694
Exec['git-pull-phalcon'],
8795
Exec['install-phalcon-1.x']],
88-
logoutput => $debug
96+
logoutput => $debug,
97+
loglevel => $loglevel
8998
}
9099

91100
php::augeas { 'php-load-phalcon-1.x':
@@ -95,7 +104,7 @@
95104
require => [
96105
File["${php::config_dir}/${ini_file}"],
97106
Exec['remove-phalcon-src-1.x']],
98-
loglevel => 'notice'
107+
loglevel => $loglevel
99108
}
100109
}
101110
}

0 commit comments

Comments
 (0)