Skip to content

Commit

Permalink
Compatibility with PE 3.3
Browse files Browse the repository at this point in the history
Add workarounds to ENTERPRISE-258 and update metadata accordingly.
  • Loading branch information
Morgan Haskel committed Aug 31, 2015
1 parent 9d5816a commit d6bdd4c
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 6 deletions.
29 changes: 25 additions & 4 deletions manifests/server/mysqltuner.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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':
Expand Down
4 changes: 2 additions & 2 deletions metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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"}
]
}

0 comments on commit d6bdd4c

Please sign in to comment.