Skip to content

Commit 0e2ca89

Browse files
authored
Merge pull request #1254 from stackhpc/fix-kayobe-blackbox-endpoints
Further fixes to Prometheus blackbox exporter endpoints
2 parents ff35522 + 631cb26 commit 0e2ca89

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

etc/kayobe/kolla/inventory/group_vars/prometheus-blackbox-exporter

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,16 @@
66
# prometheus_blackbox_exporter_endpoints_kayobe is another set of default
77
# endpoints that are templated by Kayobe rather than Kolla Ansible. See
88
# kolla/globals.yml for more details.
9-
prometheus_blackbox_exporter_endpoints: >-
10-
{{ (prometheus_blackbox_exporter_endpoints_kayobe | default([]) +
11-
prometheus_blackbox_exporter_endpoints_default) |
12-
selectattr('enabled', 'true') |
13-
map(attribute='endpoints') | flatten |
14-
union(prometheus_blackbox_exporter_endpoints_custom) |
15-
unique | select | list }}
9+
prometheus_blackbox_exporter_endpoints: |
10+
{% set endpoints = [] %}
11+
{% for dict_item in (prometheus_blackbox_exporter_endpoints_kayobe | default([]) + prometheus_blackbox_exporter_endpoints_default) %}
12+
{% if dict_item.enabled | bool %}
13+
{% for endpoint in dict_item.endpoints %}
14+
{% set _ = endpoints.append(endpoint) %}
15+
{% endfor %}
16+
{% endif %}
17+
{% endfor %}
18+
{{ (endpoints + prometheus_blackbox_exporter_endpoints_custom) | unique | select | list }}
1619

1720
# A list of custom prometheus Blackbox exporter endpoints. Each element should
1821
# have the following format:
@@ -125,7 +128,7 @@ prometheus_blackbox_exporter_endpoints_default:
125128
- endpoints:
126129
- "prometheus_alertmanager:http_2xx_alertmanager:{{ prometheus_alertmanager_public_endpoint if enable_prometheus_alertmanager_external else prometheus_alertmanager_internal_endpoint }}"
127130
enabled: "{{ enable_prometheus_alertmanager | bool }}"
128-
- endpoints: "{% set rabbitmq_endpoints = [] %}{% for host in groups.get('rabbitmq', []) %}{{ rabbitmq_endpoints.append('rabbitmq_' + host.replace('-', '') + (':tls_connect:' if rabbitmq_enable_tls else ':tcp_connect:') + ('api' | kolla_address(host) | put_address_in_context('url')) + ':' + hostvars[host]['rabbitmq_port'] ) }}{% endfor %}{{ rabbitmq_endpoints }}"
131+
- endpoints: "{% set rabbitmq_endpoints = [] %}{% for host in groups.get('rabbitmq', []) %}{{ rabbitmq_endpoints.append('rabbitmq_' + host.replace('-', '') + (':tls_connect:' if rabbitmq_enable_tls | bool else ':tcp_connect:') + ('api' | kolla_address(host) | put_address_in_context('url')) + ':' + hostvars[host]['rabbitmq_port'] ) }}{% endfor %}{{ rabbitmq_endpoints }}"
129132
enabled: "{{ enable_rabbitmq | bool }}"
130133
- endpoints: "{% set redis_endpoints = [] %}{% for host in groups.get('redis', []) %}{{ redis_endpoints.append('redis_' + host.replace('-', '') + ':tcp_connect:' + ('api' | kolla_address(host) | put_address_in_context('url')) + ':' + hostvars[host]['redis_port']) }}{% endfor %}{{ redis_endpoints }}"
131134
enabled: "{{ enable_redis | bool }}"
@@ -146,7 +149,7 @@ heat_cfn_internal_base_endpoint: "{{ heat_cfn_internal_fqdn | kolla_url(internal
146149
heat_cfn_public_base_endpoint: "{{ heat_cfn_external_fqdn | kolla_url(public_protocol, heat_api_cfn_public_port) }}"
147150
heat_internal_base_endpoint: "{{ heat_internal_fqdn | kolla_url(internal_protocol, heat_api_port) }}"
148151
heat_public_base_endpoint: "{{ heat_external_fqdn | kolla_url(public_protocol, heat_api_public_port) }}"
149-
horizon_public_endpoint: "{{ horizon_external_fqdn | kolla_url(public_protocol, horizon_listen_port) }}"
152+
horizon_public_endpoint: "{{ horizon_external_fqdn | kolla_url(public_protocol, horizon_tls_port if kolla_enable_tls_external | bool else horizon_port) }}"
150153
ironic_inspector_internal_endpoint: "{{ ironic_inspector_internal_fqdn | kolla_url(internal_protocol, ironic_inspector_port) }}"
151154
ironic_inspector_public_endpoint: "{{ ironic_inspector_external_fqdn | kolla_url(public_protocol, ironic_inspector_public_port) }}"
152155
magnum_internal_base_endpoint: "{{ magnum_internal_fqdn | kolla_url(internal_protocol, magnum_api_port) }}"

0 commit comments

Comments
 (0)