-
-
Notifications
You must be signed in to change notification settings - Fork 239
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Validate Alertmanager config Install the amtool and validate alertmanager config file prior changes. * Fixed lint and require parameter Fixed lint and require parameter * Removed trailing whitespace * Uses bind_dir Uses bin_dir instead of prometheus::server::bin_dir * Update alertmanager.pp Check Alertmanager version. * Identation corrected * Corrected notify service * Acceptance test for Alertmanager Acceptance test for Alertmanager * Alertmanager acceptance test via class Alertmanager acceptance test via class * Using my tested config for Alertmanager * Minimal configuration for Alertmanager * Fixed syntax, added missing closing braces * Removed IPv4 configuration to allow IPv6 test
- Loading branch information
1 parent
aaffe9f
commit 8925168
Showing
2 changed files
with
64 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
require 'spec_helper_acceptance' | ||
|
||
describe 'prometheus alertmanager' do | ||
it 'alertmanager works idempotently with no errors' do | ||
pp = <<-EOS | ||
class { 'prometheus::alertmanager': | ||
version => '0.17.0', | ||
extra_options => '--web.listen-address=":9093"', | ||
route => { 'receiver' => 'default' }, | ||
receivers => [ | ||
{ | ||
name => 'default', | ||
email_configs => [ | ||
send_resolved => true, | ||
to => 'test@localhost.localdomain', | ||
from => 'prometheus@localhost.localdomain', | ||
smarthost => '127.0.0.1:25', | ||
require_tls => false | ||
] | ||
} | ||
] | ||
} | ||
EOS | ||
# Run it twice and test for idempotency | ||
apply_manifest(pp, catch_failures: true) | ||
apply_manifest(pp, catch_changes: true) | ||
end | ||
|
||
describe service('alertmanager') do | ||
it { is_expected.to be_running } | ||
it { is_expected.to be_enabled } | ||
end | ||
# the class installs an the alertmanager that listens on port 9093 | ||
describe port(9093) do | ||
it { is_expected.to be_listening.with('tcp6') } | ||
end | ||
end |