From 25a183cde22b5b702e6d8ae06ddbb073bb7a7902 Mon Sep 17 00:00:00 2001 From: codec Date: Tue, 28 Apr 2015 15:45:51 +0200 Subject: [PATCH 1/4] php/init.php: do not pass $ensure to extensions most of the time this is okay for PHP extensions, because these are just packaged differently because of the distro and they will have the PHP core version number (i.e. soap will be 5.5.9-something). some extensions do proper versioning. in this case we do not want to pass this. --- manifests/init.pp | 1 - 1 file changed, 1 deletion(-) diff --git a/manifests/init.pp b/manifests/init.pp index fa40563c..592cdfdf 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -107,7 +107,6 @@ $real_extensions = hiera_hash('php::extensions', $extensions) create_resources('::php::extension', $real_extensions, { - ensure => $ensure, require => Class['::php::cli'], before => Anchor['php::end'] }) From d4785f65e10520b3cf2c30c850a9b2eaceb1d726 Mon Sep 17 00:00:00 2001 From: codec Date: Tue, 28 Apr 2015 15:47:13 +0200 Subject: [PATCH 2/4] params: change ensure to present, not latest latest may have undesired behaviour. it's more useful to set this to present (for new nodes, use the latest avail. version) but don't upgrade all the time. --- manifests/params.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/params.pp b/manifests/params.pp index d90f33c5..69ae5c38 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -2,7 +2,7 @@ # class php::params { - $ensure = 'latest' + $ensure = 'present' $fpm_service_enable = true $composer_source = 'https://getcomposer.org/composer.phar' $composer_path = '/usr/local/bin/composer' From 594b4fc8f1de454e71f7dc67ec8853f4cd0166cd Mon Sep 17 00:00:00 2001 From: Franz Pletz Date: Tue, 28 Apr 2015 17:31:30 +0200 Subject: [PATCH 3/4] params: set pear_ensure to present instead of latest We should default to ensuring present everywhere. --- manifests/params.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/params.pp b/manifests/params.pp index 69ae5c38..bb217b96 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -7,7 +7,7 @@ $composer_source = 'https://getcomposer.org/composer.phar' $composer_path = '/usr/local/bin/composer' $composer_max_age = 30 - $pear_ensure = 'latest' + $pear_ensure = 'present' $pear_package_suffix = 'pear' $phpunit_source = 'https://phar.phpunit.de/phpunit.phar' $phpunit_path = '/usr/local/bin/phpunit' From c214c2c708381caebabadf5686e70c73a08709d8 Mon Sep 17 00:00:00 2001 From: Franz Pletz Date: Tue, 28 Apr 2015 17:31:57 +0200 Subject: [PATCH 4/4] Fix spec tests to for ensure present changes --- spec/classes/php_spec.rb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/spec/classes/php_spec.rb b/spec/classes/php_spec.rb index 0199bcdf..01bdcd69 100644 --- a/spec/classes/php_spec.rb +++ b/spec/classes/php_spec.rb @@ -9,17 +9,17 @@ describe 'when called with no parameters on Debian' do it { should contain_package('php5-cli').with({ - 'ensure' => 'latest', + 'ensure' => 'present', }) should contain_class('php::fpm') should contain_package('php5-fpm').with({ - 'ensure' => 'latest', + 'ensure' => 'present', }) should contain_package('php5-dev').with({ - 'ensure' => 'latest', + 'ensure' => 'present', }) should contain_package('php-pear').with({ - 'ensure' => 'latest', + 'ensure' => 'present', }) should contain_class('php::composer') } @@ -31,13 +31,13 @@ :path => '/usr/local/bin:/usr/bin:/bin' } } it { should contain_package('php5').with({ - 'ensure' => 'latest', + 'ensure' => 'present', }) should contain_package('php5-devel').with({ - 'ensure' => 'latest', + 'ensure' => 'present', }) should contain_package('php5-pear').with({ - 'ensure' => 'latest', + 'ensure' => 'present', }) should_not contain_package('php5-cli') should_not contain_package('php5-dev')