Skip to content
This repository has been archived by the owner on Mar 6, 2023. It is now read-only.

Commit

Permalink
Merge pull request #38 from cloudalchemy/alerts
Browse files Browse the repository at this point in the history
change alert rules name; take rules from wildcard
  • Loading branch information
paulfantom authored Dec 27, 2017
2 parents b5361bf + 11062c2 commit af0becf
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tasks/configure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
- name: alerting rules file
template:
src: "alert.rules.j2"
dest: "{{ prometheus_config_dir }}/rules/alert.rules"
dest: "{{ prometheus_config_dir }}/rules/basic.rules"
owner: prometheus
group: prometheus
mode: 0644
Expand Down
2 changes: 1 addition & 1 deletion templates/alert.rules.j2
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# {{ ansible_managed }}
{% if prometheus_version | version_compare('2.0.0', '>=') %}
groups:
- name: /etc/prometheus/rules/alert.rules
- name: ansible managed alert rules
rules:
{{ prometheus_alert_rules | to_nice_yaml(indent=2) | indent(2,False) }}
{% else %}
Expand Down
2 changes: 1 addition & 1 deletion templates/prometheus.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ global:

{% if prometheus_alertmanager_config != [] and prometheus_alert_rules != [] %}
rule_files:
- {{ prometheus_config_dir }}/rules/alert.rules
- {{ prometheus_config_dir }}/rules/*.rules
{% endif %}

{% if prometheus_alertmanager_config | length > 0 %}
Expand Down
1 change: 1 addition & 0 deletions tests/test_default.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ def test_directories(host):
def test_files(host):
present = [
"/etc/prometheus/prometheus.yml",
"/etc/prometheus/rules/basic.rules",
"/etc/systemd/system/prometheus.service",
"/opt/prometheus/prometheus",
"/opt/prometheus/promtool"
Expand Down

0 comments on commit af0becf

Please sign in to comment.