diff --git a/manifests/server/backup.pp b/manifests/server/backup.pp index 3b1f1eebe..2c98284a9 100644 --- a/manifests/server/backup.pp +++ b/manifests/server/backup.pp @@ -23,7 +23,7 @@ ) { 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', { diff --git a/manifests/server/mysqltuner.pp b/manifests/server/mysqltuner.pp index 830711067..bc5fcadc0 100644 --- a/manifests/server/mysqltuner.pp +++ b/manifests/server/mysqltuner.pp @@ -14,14 +14,35 @@ } 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 a226e1b1c..a077391fc 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"} ] }