3c872abcd2
mysqltuner is licensed under GPL so we don't want to package it with the module.
31 lines
680 B
Puppet
31 lines
680 B
Puppet
#
|
|
class mysql::server::mysqltuner(
|
|
$ensure = 'present',
|
|
$version = 'v1.3.0',
|
|
$source = undef,
|
|
) {
|
|
|
|
if $source {
|
|
$_version = $source
|
|
$_source = $source
|
|
} else {
|
|
$_version = $version
|
|
$_source = "https://github.com/major/MySQLTuner-perl/raw/${version}/mysqltuner.pl"
|
|
}
|
|
|
|
if $ensure == 'present' {
|
|
class { 'staging': }
|
|
staging::file { "mysqltuner-${_version}":
|
|
source => $_source,
|
|
}
|
|
file { '/usr/local/bin/mysqltuner':
|
|
ensure => $ensure,
|
|
mode => '0550',
|
|
source => "${::staging::path}/mysql/mysqltuner-${_version}",
|
|
}
|
|
} else {
|
|
file { '/usr/local/bin/mysqltuner':
|
|
ensure => $ensure,
|
|
}
|
|
}
|
|
}
|