From 9d5816ad5c338efe575adce51434b91ba654e6f1 Mon Sep 17 00:00:00 2001 From: Christoph Fiehe Date: Wed, 12 Aug 2015 07:30:42 +0200 Subject: [PATCH 1/2] Fixes improper use of function 'warn' in backup manifest of server. Have a look to the following sites: https://ask.puppetlabs.com/question/13288/whats-the-difference-between-warn-and-warning/ https://docs.puppetlabs.com/puppet/latest/reference/lang_conditional.html?_ga=1.41504802.1433359326.1439356343 --- manifests/server/backup.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/server/backup.pp b/manifests/server/backup.pp index 3b1f1ee..2c98284 100644 --- a/manifests/server/backup.pp +++ b/manifests/server/backup.pp @@ -23,7 +23,7 @@ class mysql::server::backup ( ) { if $prescript and $provider =~ /(mysqldump|mysqlbackup)/ { - warn("The \$prescript option is not currently implemented for the ${provider} backup provider.") + warning("The \$prescript option is not currently implemented for the ${provider} backup provider.") } create_resources('class', { From d6bdd4cb3e00641acccd28faa522ef1ad4f38ce2 Mon Sep 17 00:00:00 2001 From: Morgan Haskel Date: Mon, 31 Aug 2015 14:31:17 -0700 Subject: [PATCH 2/2] Compatibility with PE 3.3 Add workarounds to ENTERPRISE-258 and update metadata accordingly. --- manifests/server/mysqltuner.pp | 29 +++++++++++++++++++++++++---- metadata.json | 4 ++-- 2 files changed, 27 insertions(+), 6 deletions(-) diff --git a/manifests/server/mysqltuner.pp b/manifests/server/mysqltuner.pp index 8307110..bc5fcad 100644 --- a/manifests/server/mysqltuner.pp +++ b/manifests/server/mysqltuner.pp @@ -14,14 +14,35 @@ class mysql::server::mysqltuner( } if $ensure == 'present' { - class { 'staging': } + # $::puppetversion doesn't exist in puppet 4.x so would break strict + # variables + if ! $::settings::strict_variables { + $_puppetversion = $::puppetversion + } else { + # defined only works with puppet >= 3.5.0, so don't use it unless we're + # actually using strict variables + $_puppetversion = defined('$puppetversion') ? { + true => $::puppetversion, + default => undef, + } + } + # see https://tickets.puppetlabs.com/browse/ENTERPRISE-258 + if $_puppetversion and $_puppetversion =~ /Puppet Enterprise/ and versioncmp($_puppetversion, '3.8.0') < 0 { + class { 'staging': + path => '/opt/mysql_staging', + } + } else { + class { 'staging': } + } + staging::file { "mysqltuner-${_version}": source => $_source, } file { '/usr/local/bin/mysqltuner': - ensure => $ensure, - mode => '0550', - source => "${::staging::path}/mysql/mysqltuner-${_version}", + ensure => $ensure, + mode => '0550', + source => "${::staging::path}/mysql/mysqltuner-${_version}", + require => Staging::File["mysqltuner-${_version}"], } } else { file { '/usr/local/bin/mysqltuner': diff --git a/metadata.json b/metadata.json index a226e1b..a077391 100644 --- a/metadata.json +++ b/metadata.json @@ -74,7 +74,7 @@ "requirements": [ { "name": "pe", - "version_requirement": ">= 3.7.0 < 2015.3.0" + "version_requirement": ">= 3.0.0 < 2015.3.0" }, { "name": "puppet", @@ -84,6 +84,6 @@ "description": "Mysql module", "dependencies": [ {"name":"puppetlabs/stdlib","version_requirement":">= 3.2.0 < 5.0.0"}, - {"name":"nanliu/staging","version_requirement":"1.x"} + {"name":"nanliu/staging","version_requirement":">= 1.0.1 < 2.0.0"} ] }