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)
- name: wait for grafana to be stopped
wait_for:
+ host: '{{ grafana_server_addr }}'
port: '{{ grafana_port }}'
state: stopped
- name: wait for grafana to start
wait_for:
+ host: '{{ grafana_server_addr }}'
port: '{{ grafana_port }}'
# <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
domain = {{ ansible_fqdn }}
protocol = {{ dashboard_protocol }}
http_port = {{ grafana_port }}
+http_addr = {{ grafana_server_addr }}
[security]
admin_user = {{ grafana_admin_user }}
alertmanagers:
- scheme: http
static_configs:
- - targets: ['{{ grafana_server_addr | default(_current_monitor_address) }}:{{ alertmanager_port }}']
+ - targets: ['{{ grafana_server_addr }}:{{ alertmanager_port }}']