Skip to content

Commit

Permalink
Merge pull request voxpupuli#241 from bramblek1/180_rule_files_param
Browse files Browse the repository at this point in the history
180 rule files param
  • Loading branch information
bastelfreak authored Jul 30, 2018
2 parents 3148751 + 24382eb commit 9083f1c
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
4 changes: 1 addition & 3 deletions data/defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,7 @@ prometheus::beanstalkd_exporter::mapping_config: '/etc/beanstalkd-exporter-mappi
prometheus::beanstalkd_exporter::config: '/etc/beanstalkd-exporter.conf'
prometheus::package_ensure: 'latest'
prometheus::package_name: 'prometheus'
prometheus::alertfile_name: 'alert'
prometheus::rule_files:
- "$prometheus::{config_dir}/$prometheus::{alertfile_name}.rules"
prometheus::rule_files: []
prometheus::scrape_configs:
- 'job_name': 'prometheus'
'scrape_interval': '10s'
Expand Down
4 changes: 2 additions & 2 deletions manifests/server.pp
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,10 @@
alerts => $alerts,
location => $config_dir,
}
$_rule_files = concat(["${config_dir}/alert.rules"], $extra_rule_files)
$_rule_files = concat(["${config_dir}/alert.rules"], $extra_rule_files, $rule_files)
}
else {
$_rule_files = $extra_rule_files
$_rule_files = concat($extra_rule_files, $rule_files)
}
contain prometheus::install
contain prometheus::config
Expand Down
2 changes: 1 addition & 1 deletion spec/classes/prometheus_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
facts.merge(os_specific_facts(facts))
end

[{ manage_prometheus_server: true, version: '2.0.0-rc.1', bin_dir: '/usr/local/bin', install_method: 'url' }].each do |parameters|
[{ manage_prometheus_server: true, version: '2.0.0-rc.1', bin_dir: '/usr/local/bin', install_method: 'url', rule_files: ['/etc/prometheus/rules.d/*.rules'] }].each do |parameters|
context "with parameters #{parameters}" do
let(:params) do
parameters
Expand Down
3 changes: 2 additions & 1 deletion spec/fixtures/files/prometheus1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ global:
evaluation_interval: 15s
external_labels:
monitor: master
rule_files: []
rule_files:
- "/etc/prometheus/rules.d/*.rules"
scrape_configs:
- job_name: prometheus
scrape_interval: 10s
Expand Down
3 changes: 2 additions & 1 deletion spec/fixtures/files/prometheus2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ global:
evaluation_interval: 15s
external_labels:
monitor: master
rule_files: []
rule_files:
- "/etc/prometheus/rules.d/*.rules"
scrape_configs:
- job_name: prometheus
scrape_interval: 10s
Expand Down

0 comments on commit 9083f1c

Please sign in to comment.