Skip to content

Commit 19ddfa3

Browse files
committed
Get the actual variable instead of the group name
1 parent d3d81fa commit 19ddfa3

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

provision-contest/ansible/roles/grafana/templates/prometheus.yml.j2

+5-5
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ scrape_configs:
1414
- job_name: node_judgehost
1515
basic_auth:
1616
username: "prometheus"
17-
password: "{{ groups[group_prefix+"judgehost"][0]['PROMETHEUS_PASS'] }}"
17+
password: "{{ hostvars[groups[group_prefix+"judgehost"][0]]['PROMETHEUS_PASS'] }}"
1818
tls_config:
1919
insecure_skip_verify: true
2020
scheme: https
@@ -41,7 +41,7 @@ scrape_configs:
4141
- job_name: {{ group_prefix ~ 'db' }}
4242
basic_auth:
4343
username: "prometheus"
44-
password: "{{ groups[group_prefix+"domserver"][0]['PROMETHEUS_PASS'] }}"
44+
password: "{{ hostvars[groups[group_prefix+"domserver"][0]]['PROMETHEUS_PASS'] }}"
4545
tls_config:
4646
insecure_skip_verify: true
4747
scheme: https
@@ -53,7 +53,7 @@ scrape_configs:
5353
- job_name: {{ group_prefix ~ 'node_domserver' }}
5454
basic_auth:
5555
username: "prometheus"
56-
password: "{{ groups[group_prefix+"domserver"][0]['PROMETHEUS_PASS'] }}"
56+
password: "{{ hostvars[groups[group_prefix+"domserver"][0]]['PROMETHEUS_PASS'] }}"
5757
tls_config:
5858
insecure_skip_verify: true
5959
scheme: https
@@ -65,7 +65,7 @@ scrape_configs:
6565
- job_name: {{ group_prefix ~ 'web_nginx_domserver' }}
6666
basic_auth:
6767
username: "prometheus"
68-
password: "{{ groups[group_prefix+"domserver"][0]['PROMETHEUS_PASS'] }}"
68+
password: "{{ hostvars[groups[group_prefix+"domserver"][0]]['PROMETHEUS_PASS'] }}"
6969
tls_config:
7070
insecure_skip_verify: true
7171
scheme: https
@@ -77,7 +77,7 @@ scrape_configs:
7777
- job_name: {{ group_prefix ~ 'web_fpm_domserver' }}
7878
basic_auth:
7979
username: "prometheus"
80-
password: "{{ groups[group_prefix+"domserver"][0]['PROMETHEUS_PASS'] }}"
80+
password: "{{ hostvars[groups[group_prefix+"domserver"][0]]['PROMETHEUS_PASS'] }}"
8181
tls_config:
8282
insecure_skip_verify: true
8383
scheme: https

0 commit comments

Comments
 (0)