From 53c1c4e14eb1f9c1614ee5bca6ddefc98074f451 Mon Sep 17 00:00:00 2001 From: Ryan Gibbons Date: Wed, 16 Jan 2013 10:06:02 -0700 Subject: [PATCH 1/6] set a class variable on each that sets $version to present and uses it on all packages --- manifests/apache2/install.pp | 4 ++-- manifests/fpm/install.pp | 4 ++-- manifests/init.pp | 9 +++++++-- manifests/install.pp | 4 ++-- 4 files changed, 13 insertions(+), 8 deletions(-) diff --git a/manifests/apache2/install.pp b/manifests/apache2/install.pp index aef15a2..5e1c613 100644 --- a/manifests/apache2/install.pp +++ b/manifests/apache2/install.pp @@ -1,6 +1,6 @@ -class php::apache2::install { +class php::apache2::install ($version = 'present') { package { $php::params::apache_package_name: - ensure => present, + ensure => $version, notify => Service[$php::params::apache_service_name], } } diff --git a/manifests/fpm/install.pp b/manifests/fpm/install.pp index fadb205..de4cbcc 100644 --- a/manifests/fpm/install.pp +++ b/manifests/fpm/install.pp @@ -1,6 +1,6 @@ -class php::fpm::install { +class php::fpm::install ($version = 'present') { package { $php::params::fpm_package_name: - ensure => present, + ensure => $version, require => Class['php'], } } diff --git a/manifests/init.pp b/manifests/init.pp index e93825b..f4433c8 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -1,6 +1,11 @@ -class php( +class php ( + $version = 'present', $cli_ini_content = undef, $cli_ini_source = undef ) { - include php::params, php::install, php::config + class { 'php::params': } + class { 'php::install': + version => $version + } + class { 'php::config': } } diff --git a/manifests/install.pp b/manifests/install.pp index 5b812d5..eb6b1a6 100644 --- a/manifests/install.pp +++ b/manifests/install.pp @@ -1,5 +1,5 @@ -class php::install { +class php::install ($version = 'present') { package { $php::params::cli_package_name: - ensure => present, + ensure => $version, } } From 64f1d341463c6acc227303db97addf12a41703ce Mon Sep 17 00:00:00 2001 From: Ryan Gibbons Date: Wed, 16 Jan 2013 17:17:04 -0700 Subject: [PATCH 2/6] php fpm install using proper versioning --- manifests/fpm.pp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/manifests/fpm.pp b/manifests/fpm.pp index 096f0b3..553c7c4 100644 --- a/manifests/fpm.pp +++ b/manifests/fpm.pp @@ -1,11 +1,16 @@ class php::fpm ( + $version = present, $fpm_ini_content = undef, $fpm_ini_source = undef, $fpm_conf_content = undef, $fpm_conf_source = undef ) { - include php - include php::fpm::install + class { 'php': + version: $version + } + class { 'php::fpm::install': + version: $version + } include php::fpm::config include php::fpm::service From ce2f1392e0f771bfe65bb4065ae065c2925b3bda Mon Sep 17 00:00:00 2001 From: Ryan Gibbons Date: Wed, 16 Jan 2013 17:25:25 -0700 Subject: [PATCH 3/6] confirm module class to use version vs ensure --- manifests/module.pp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/manifests/module.pp b/manifests/module.pp index 0049535..1981784 100644 --- a/manifests/module.pp +++ b/manifests/module.pp @@ -1,5 +1,5 @@ define php::module( - $ensure = present, + $version = present, $package_prefix = 'php5-', $source = undef, $content = undef, @@ -20,7 +20,7 @@ } package { "php-${name}": - ensure => $ensure, + ensure => $version, name => "${package_prefix}${name}", require => $real_require, } @@ -42,7 +42,7 @@ } file { $file_name: - ensure => $ensure, + ensure => $version, path => "${php::params::conf_dir}${file_name}", mode => '0644', owner => 'root', From 39526a038465dcdd4441cdd7cf51c11c7d87e889 Mon Sep 17 00:00:00 2001 From: Ryan Gibbons Date: Wed, 16 Jan 2013 23:43:51 -0700 Subject: [PATCH 4/6] fixed typo in assignment --- manifests/fpm.pp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifests/fpm.pp b/manifests/fpm.pp index 553c7c4..de57af2 100644 --- a/manifests/fpm.pp +++ b/manifests/fpm.pp @@ -6,10 +6,10 @@ $fpm_conf_source = undef ) { class { 'php': - version: $version + version => $version } class { 'php::fpm::install': - version: $version + version => $version } include php::fpm::config include php::fpm::service From a719a63a8f1ad9141a79ae9cc28f22213b43ad37 Mon Sep 17 00:00:00 2001 From: Ryan Gibbons Date: Fri, 18 Jan 2013 08:52:32 -0700 Subject: [PATCH 5/6] aligning variables --- manifests/fpm.pp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/manifests/fpm.pp b/manifests/fpm.pp index de57af2..0b7f75c 100644 --- a/manifests/fpm.pp +++ b/manifests/fpm.pp @@ -1,9 +1,9 @@ class php::fpm ( - $version = present, - $fpm_ini_content = undef, - $fpm_ini_source = undef, + $version = present, + $fpm_ini_content = undef, + $fpm_ini_source = undef, $fpm_conf_content = undef, - $fpm_conf_source = undef + $fpm_conf_source = undef ) { class { 'php': version => $version From 2e4b83151f9c52c12408b09f04d1cd9bb1de3cdd Mon Sep 17 00:00:00 2001 From: Ryan Gibbons Date: Fri, 25 Jan 2013 12:08:57 -0700 Subject: [PATCH 6/6] fixing file ensure --- manifests/module.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/module.pp b/manifests/module.pp index 1981784..40475ff 100644 --- a/manifests/module.pp +++ b/manifests/module.pp @@ -42,7 +42,7 @@ } file { $file_name: - ensure => $version, + ensure => present, path => "${php::params::conf_dir}${file_name}", mode => '0644', owner => 'root',