Skip to content

Commit dac8e2d

Browse files
author
tphoney
committed
(MODULES-6923) replace staging module with archive
1 parent 0915ae1 commit dac8e2d

File tree

4 files changed

+16
-42
lines changed

4 files changed

+16
-42
lines changed

.fixtures.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
fixtures:
22
repositories:
3+
"archive": "https://github.com/voxpupuli/puppet-archive"
34
"stdlib": "https://github.com/puppetlabs/puppetlabs-stdlib"
4-
"staging": "https://github.com/voxpupuli/puppet-staging"
55
"translate": "https://github.com/puppetlabs/puppetlabs-translate"
66
symlinks:
77
"mysql": "#{source_dir}"

manifests/server/mysqltuner.pp

+7-28
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
$environment = undef, # environment for staging::file
1818
) {
1919

20+
$tuner_location = '/usr/local/bin/mysqltuner'
2021
if $source {
2122
$_version = $source
2223
$_source = $source
@@ -26,39 +27,17 @@
2627
}
2728

2829
if $ensure == 'present' {
29-
# $::puppetversion doesn't exist in puppet 4.x so would break strict
30-
# variables
31-
if ! $::settings::strict_variables {
32-
$_puppetversion = $::puppetversion
33-
} else {
34-
# defined only works with puppet >= 3.5.0, so don't use it unless we're
35-
# actually using strict variables
36-
$_puppetversion = defined('$puppetversion') ? {
37-
true => $::puppetversion,
38-
default => undef,
39-
}
40-
}
41-
# see https://tickets.puppetlabs.com/browse/ENTERPRISE-258
42-
if $_puppetversion and $_puppetversion =~ /Puppet Enterprise/ and versioncmp($_puppetversion, '3.8.0') < 0 {
43-
class { '::staging':
44-
path => '/opt/mysql_staging',
45-
}
46-
} else {
47-
class { '::staging': }
48-
}
49-
50-
staging::file { "mysqltuner-${_version}":
51-
source => $_source,
52-
environment => $environment,
30+
archive { $tuner_location:
31+
ensure => $ensure,
32+
source => $_source,
5333
}
54-
file { '/usr/local/bin/mysqltuner':
34+
file { $tuner_location:
5535
ensure => $ensure,
5636
mode => '0550',
57-
source => "${::staging::path}/mysql/mysqltuner-${_version}",
58-
require => Staging::File["mysqltuner-${_version}"],
37+
require => Archive[$tuner_location],
5938
}
6039
} else {
61-
file { '/usr/local/bin/mysqltuner':
40+
file { $tuner_location:
6241
ensure => $ensure,
6342
}
6443
}

metadata.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@
99
"issues_url": "https://tickets.puppetlabs.com/browse/MODULES",
1010
"dependencies": [
1111
{
12-
"name": "puppetlabs/translate",
13-
"version_requirement": ">= 1.0.0 < 2.0.0"
12+
"name": "puppet/archive",
13+
"version_requirement": ">= 3.2.0 < 4.0.0"
1414
},
1515
{
1616
"name": "puppetlabs/stdlib",
1717
"version_requirement": ">= 3.2.0 < 5.0.0"
1818
},
1919
{
20-
"name": "puppet/staging",
21-
"version_requirement": ">= 1.0.1 < 4.0.0"
20+
"name": "puppetlabs/translate",
21+
"version_requirement": ">= 1.0.0 < 2.0.0"
2222
}
2323
],
2424
"operatingsystem_support": [

spec/classes/mysql_server_mysqltuner_spec.rb

+4-9
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,12 @@
11
require 'spec_helper'
22

33
describe 'mysql::server::mysqltuner' do
4-
on_supported_os.each do |os, facts|
4+
on_supported_os.each do |os, _facts|
55
context "on #{os}" do
6-
let(:facts) do
7-
facts.merge(staging_http_get: 'curl',
8-
root_home: '/root')
9-
end
10-
116
context 'ensure => present' do
127
it { is_expected.to compile }
138
it {
14-
is_expected.to contain_staging__file('mysqltuner-v1.3.0').with(source: 'https://github.com/major/MySQLTuner-perl/raw/v1.3.0/mysqltuner.pl')
9+
is_expected.to contain_archive('/usr/local/bin/mysqltuner')
1510
}
1611
end
1712

@@ -27,7 +22,7 @@
2722

2823
it { is_expected.to compile }
2924
it {
30-
is_expected.to contain_staging__file('mysqltuner-v1.2.0').with(source: 'https://github.com/major/MySQLTuner-perl/raw/v1.2.0/mysqltuner.pl')
25+
is_expected.to contain_archive('/usr/local/bin/mysqltuner')
3126
}
3227
end
3328

@@ -36,7 +31,7 @@
3631

3732
it { is_expected.to compile }
3833
it {
39-
is_expected.to contain_staging__file('mysqltuner-/tmp/foo').with(source: '/tmp/foo')
34+
is_expected.to contain_archive('/usr/local/bin/mysqltuner')
4035
}
4136
end
4237
end

0 commit comments

Comments
 (0)