1
0
Fork 0
mirror of https://gitlab.com/s3lph/ansible-collection-prometheus synced 2024-10-23 03:46:59 +02:00

Fix conflicting variable names

This commit is contained in:
s3lph 2021-11-06 05:52:36 +01:00
parent 12ad0c0dc3
commit 53c7a9ca75
2 changed files with 3 additions and 3 deletions

View file

@ -21,14 +21,14 @@
mode: 0644
validate: /usr/bin/promtool check rules %s
vars:
groups: "{{ hostvars[inventory_hostname] | dict2items | selectattr('key', 'match', '^prometheus_job_.+$') | map(attribute='value') | map(attribute='group') | unique | default([prometheus_job_default_group_name]) }}"
alert_groups: "{{ hostvars[inventory_hostname] | dict2items | selectattr('key', 'match', '^prometheus_job_.+$') | map(attribute='value') | map(attribute='group') | unique | default([prometheus_job_default_group_name]) }}"
jobs: "{{ hostvars[inventory_hostname] | dict2items | selectattr('key', 'match', '^prometheus_job_.+$') | map(attribute='value') | list }}"
notify: restart prometheus
- name: render /etc/default/prometheus
ansible.builtin.template:
src: etc/default/prometheus.j2
path: /etc/default/prometheus
dest: /etc/default/prometheus
owner: root
group: root
mode: 0644

View file

@ -3,7 +3,7 @@
groups:
{% for group in groups %}
{% for group in alert_groups %}
- name: {{ group }}
rules: