From 3caba2c31c0b0d1774103f984ce23a7135ba42b9 Mon Sep 17 00:00:00 2001 From: Guillaume Abrioux Date: Thu, 2 Jan 2020 18:09:38 +0100 Subject: [PATCH] dashboard: use fqdn in external url Force fqdn to be used in external url for prometheus and alertmanager. Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1765485 Signed-off-by: Guillaume Abrioux (cherry picked from commit 498bc45859f9a7ac4b3ac419e21852164f8a762e) --- roles/ceph-prometheus/templates/alertmanager.service.j2 | 1 + roles/ceph-prometheus/templates/prometheus.service.j2 | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/roles/ceph-prometheus/templates/alertmanager.service.j2 b/roles/ceph-prometheus/templates/alertmanager.service.j2 index 6e3b33eb3..64b264e0b 100644 --- a/roles/ceph-prometheus/templates/alertmanager.service.j2 +++ b/roles/ceph-prometheus/templates/alertmanager.service.j2 @@ -23,6 +23,7 @@ ExecStart=/usr/bin/{{ container_binary }} run --rm --name=alertmanager \ {{ alertmanager_container_image }} \ --config.file=/etc/alertmanager/alertmanager.yml \ --storage.path=/alertmanager \ + --web.external-url=http://{{ ansible_fqdn }}:{{ alertmanager_port }}/ \ --web.listen-address=:{{ alertmanager_port }} ExecStop=/usr/bin/{{ container_binary }} stop alertmanager Restart=always diff --git a/roles/ceph-prometheus/templates/prometheus.service.j2 b/roles/ceph-prometheus/templates/prometheus.service.j2 index 919090815..bbaed8829 100644 --- a/roles/ceph-prometheus/templates/prometheus.service.j2 +++ b/roles/ceph-prometheus/templates/prometheus.service.j2 @@ -23,7 +23,7 @@ ExecStart=/usr/bin/{{ container_binary }} run --rm --name=prometheus \ {{ prometheus_container_image }} \ --config.file=/etc/prometheus/prometheus.yml \ --storage.tsdb.path=/prometheus \ - --web.external-url=http://{{ inventory_hostname }}:{{ prometheus_port }}/ \ + --web.external-url=http://{{ ansible_fqdn }}:{{ prometheus_port }}/ \ --web.listen-address=:{{ prometheus_port }} ExecStop=/usr/bin/{{ container_binary }} stop prometheus Restart=always -- 2.39.5