1
0
Fork 0
mirror of https://gitlab.com/s3lph/ansible-collection-prometheus synced 2024-11-23 02:01:10 +01: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 mode: 0644
validate: /usr/bin/promtool check rules %s validate: /usr/bin/promtool check rules %s
vars: 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 }}" jobs: "{{ hostvars[inventory_hostname] | dict2items | selectattr('key', 'match', '^prometheus_job_.+$') | map(attribute='value') | list }}"
notify: restart prometheus notify: restart prometheus
- name: render /etc/default/prometheus - name: render /etc/default/prometheus
ansible.builtin.template: ansible.builtin.template:
src: etc/default/prometheus.j2 src: etc/default/prometheus.j2
path: /etc/default/prometheus dest: /etc/default/prometheus
owner: root owner: root
group: root group: root
mode: 0644 mode: 0644

View file

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