Skip to content

Commit

Permalink
Use grafana_server_addr to set prometheus networks list
Browse files Browse the repository at this point in the history
When dashboard is enabled and module ceph_orch_apply is
called, if the grafana_server_addr is defined, then it
is used to populate the networks list in the spec of type
alertmanager. This is the case without this patch. With
this patch the same logic is applied to the spec of type
prometheus. Also, if the grafana_server_addr is a comma
delimited list, then a jinja2 expression handles passing
the IPs as a list.

Without this patch prometheus binds to all networks even
if grafana_server_addr is set which can create conflicts
with other services.

Fixes: https://bugzilla.redhat.com/2269009

Signed-off-by: John Fulton <[email protected]>
(cherry picked from commit 770a527)
  • Loading branch information
fultonj authored and mergify[bot] committed Feb 6, 2025
1 parent 8b0339a commit 0458c53
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions infrastructure-playbooks/cephadm-adopt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1487,8 +1487,7 @@
label: "{{ monitoring_group_name }}"
count: "{{ groups.get(monitoring_group_name, []) | length }}"
{% if grafana_server_addr is defined %}
networks:
- {{ grafana_server_addr }}
networks: {{ grafana_server_addr.split(',') | list if ',' in grafana_server_addr else grafana_server_addr | string }}
{% endif %}
delegate_to: "{{ groups[mon_group_name][0] }}"
environment:
Expand All @@ -1509,6 +1508,9 @@
placement:
label: {{ monitoring_group_name }}
count: {{ groups.get(monitoring_group_name, []) | length }}
{% if grafana_server_addr is defined %}
networks: {{ grafana_server_addr.split(',') | list if ',' in grafana_server_addr else grafana_server_addr | string }}
{% endif %}
{% if prometheus_port is defined and prometheus_port != 9095 %}
spec:
port: {{ prometheus_port }}
Expand Down

0 comments on commit 0458c53

Please sign in to comment.