Compatibility with PE 3.3

Add workarounds to ENTERPRISE-258 and update metadata accordingly.
This commit is contained in:
Morgan Haskel 2015-08-31 14:31:17 -07:00
parent 9d5816ad5c
commit d6bdd4cb3e
2 changed files with 27 additions and 6 deletions

View file

@ -14,7 +14,27 @@ class mysql::server::mysqltuner(
}
if $ensure == 'present' {
# $::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,
}
@ -22,6 +42,7 @@ class mysql::server::mysqltuner(
ensure => $ensure,
mode => '0550',
source => "${::staging::path}/mysql/mysqltuner-${_version}",
require => Staging::File["mysqltuner-${_version}"],
}
} else {
file { '/usr/local/bin/mysqltuner':

View file

@ -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"}
]
}