-
-
Notifications
You must be signed in to change notification settings - Fork 241
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added ability to delete old releases
Move the URL releases to their own directory under /opt to create the possibility for Puppet to remove old releases that are no longer used.
- Loading branch information
1 parent
001ec20
commit 7095b41
Showing
19 changed files
with
191 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'spec_helper_acceptance' | ||
|
||
describe 'prometheus node_exporter' do | ||
it 'prometheus do not clean URL releases' do | ||
pp_dirty_v0152 = <<-EOS | ||
class { 'prometheus': | ||
clean_url_releases => false, | ||
} | ||
class { 'prometheus::node_exporter': | ||
version => '0.15.2', | ||
} | ||
EOS | ||
|
||
pp_dirty_v0160 = <<-EOS | ||
class { 'prometheus': | ||
clean_url_releases => false, | ||
} | ||
class { 'prometheus::node_exporter': | ||
version => '0.16.0', | ||
} | ||
EOS | ||
|
||
# Run it twice and test for idempotency | ||
apply_manifest(pp_dirty_v0152, catch_failures: true) | ||
apply_manifest(pp_dirty_v0152, catch_changes: true) | ||
|
||
# Run it twice and test for idempotency | ||
apply_manifest(pp_dirty_v0160, catch_failures: true) | ||
apply_manifest(pp_dirty_v0160, catch_changes: true) | ||
|
||
# Check that the exporter still runs | ||
describe service('node_exporter') do | ||
it { is_expected.to be_running } | ||
it { is_expected.to be_enabled } | ||
end | ||
|
||
describe port(9100) do | ||
it { is_expected.to be_listening.with('tcp6') } | ||
end | ||
|
||
shell('ls -A1 /opt') do |r| | ||
expect(r.stdout).to match(%r{^\s*node_exporter-0\.15\.2\.linux-amd64\s*$}) | ||
expect(r.stdout).to match(%r{^\s*node_exporter-0\.16\.0\.linux-amd64\s*$}) | ||
expect(r.stdout).not_to match(%r{^\s*prometheus\s*$}) | ||
expect(r.exit_code).to eq(0) | ||
end | ||
end | ||
|
||
it 'prometheus do clean URL releases' do | ||
pp_clean_v0152 = <<-EOS | ||
class { 'prometheus': | ||
clean_url_releases => false, | ||
} | ||
class { 'prometheus::node_exporter': | ||
version => '0.15.2', | ||
} | ||
EOS | ||
|
||
pp_clean_v0160 = <<-EOS | ||
class { 'prometheus': | ||
clean_url_releases => false, | ||
} | ||
class { 'prometheus::node_exporter': | ||
version => '0.16.0', | ||
} | ||
EOS | ||
|
||
# Run it twice and test for idempotency | ||
apply_manifest(pp_clean_v0152, catch_failures: true) | ||
apply_manifest(pp_clean_v0152, catch_changes: true) | ||
|
||
# Run it twice and test for idempotency | ||
apply_manifest(pp_clean_v0160, catch_failures: true) | ||
apply_manifest(pp_clean_v0160, catch_changes: true) | ||
|
||
# Check that the exporter still runs | ||
describe service('node_exporter') do | ||
it { is_expected.to be_running } | ||
it { is_expected.to be_enabled } | ||
end | ||
|
||
describe port(9100) do | ||
it { is_expected.to be_listening.with('tcp6') } | ||
end | ||
|
||
shell('ls -A1 /opt/prometheus') do |r| | ||
expect(r.stdout).not_to match(%r{^\s*node_exporter-0\.15\.2\.linux-amd64\s*$}) | ||
expect(r.stdout).to match(%r{^\s*node_exporter-0\.16\.0\.linux-amd64\s*$}) | ||
expect(r.exit_code).to eq(0) | ||
end | ||
end | ||
end |
Oops, something went wrong.