Skip to content
Snippets Groups Projects
Commit 7465ced7 authored by Thomas Schneider's avatar Thomas Schneider
Browse files

Merge rules variables and files

parent d1866278
Branches
No related tags found
No related merge requests found
---
prometheus_args: ""
prometheus:
rules:
# These variables intentionally left null. They need to exist, so that the
# template works, but they need to have a value (empty string does not
# work).
alert: null
recording: null
# This variable intentionally left null. They need to exist, so that the
# template works, but they need to have a value (empty string does not work).
prometheus_rules: null
......@@ -43,12 +43,9 @@
- name: Configure rules
template:
src: "{{ item }}_rules.yml.j2"
dest: "/etc/prometheus/rules/ansible_{{ item }}.yml"
src: "rules.yml.j2"
dest: "/etc/prometheus/rules/ansible_rules.yml"
validate: "promtool check rules %s"
with_items:
- alert
- recording
notify:
- Reload prometheus
tags:
......
{{ prometheus.rules.alert|to_nice_yaml }}
{{ prometheus.rules.recording|to_nice_yaml }}
{{ prometheus_rules|to_nice_yaml|replace('[[', '{{')|replace(']]', '}}') }}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment