]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
Add http_addr option to grafana config
authorfmount <fpantano@redhat.com>
Fri, 23 Aug 2019 08:00:30 +0000 (10:00 +0200)
committerDimitri Savineau <savineau.dimitri@gmail.com>
Fri, 30 Aug 2019 13:04:16 +0000 (09:04 -0400)
We have no reason to make grafana container
listen on *:<port>, so this change adds the
http_addr option to the grafana config file
and adds the related option on the wait_for
tasks.
Since grafana_server_addr should exists, we
shouldn't rely on the _current_monitor_addr
default on prometheus/grafana templates.
This change also remove this default value
that is not necessary anymore.

Signed-off-by: fmount <fpantano@redhat.com>
(cherry picked from commit 8a666bfd1554267859a39c0f87fe3fb1ea1c7418)

roles/ceph-grafana/tasks/configure_grafana.yml
roles/ceph-grafana/templates/datasources-ceph-dashboard.yml.j2
roles/ceph-grafana/templates/grafana.ini.j2
roles/ceph-prometheus/templates/prometheus.yml.j2

index bfec46574c011f2f2f8cb5a4305cd0bc92c814a6..70963491cb402dc3dbc7ead30e74f85d1c72c92b 100644 (file)
@@ -17,6 +17,7 @@
 
 - name: wait for grafana to be stopped
   wait_for:
+    host: '{{ grafana_server_addr }}'
     port: '{{ grafana_port }}'
     state: stopped
 
@@ -97,4 +98,5 @@
 
 - name: wait for grafana to start
   wait_for:
+    host: '{{ grafana_server_addr }}'
     port: '{{ grafana_port }}'
index 4746fb31281da83a7e72084f7689b764f04768f5..0ff13ad5763ed357a4d3ec2b10aa3c07f0eb8492 100644 (file)
@@ -17,7 +17,7 @@ datasources:
   # <int> org id. will default to orgId 1 if not specified
   orgId: 1
   # <string> url
-  url: 'http://{{ grafana_server_addr | default(_current_monitor_address) }}:{{ prometheus_port }}'
+  url: 'http://{{ grafana_server_addr }}:{{ prometheus_port }}'
   # <bool> enable/disable basic auth
   basicAuth: false
   # <bool> mark as default datasource. Max one per org
index ff5f694576899a9c17092e93d1820b85920065c6..4c897b2dec126f7f36efedcdf0d253ecd8fc0133 100644 (file)
@@ -21,6 +21,7 @@ cert_key = /etc/grafana/ceph-dashboard.key
 domain = {{ ansible_fqdn }}
 protocol = {{ dashboard_protocol }}
 http_port = {{ grafana_port }}
+http_addr = {{ grafana_server_addr }}
 
 [security]
 admin_user = {{ grafana_admin_user }}
index 1afc9ee816c52d17ff1123927893b6901141b386..3530357e5cd0a2cd56cdefe76b453dac83ab0dec 100644 (file)
@@ -52,4 +52,4 @@ alerting:
   alertmanagers:
   - scheme: http
     static_configs:
-    - targets: ['{{ grafana_server_addr | default(_current_monitor_address) }}:{{ alertmanager_port }}']
+    - targets: ['{{ grafana_server_addr }}:{{ alertmanager_port }}']