From ee920b5a9b3dfde468b1509c4e2186e485ab4a24 Mon Sep 17 00:00:00 2001 From: Paulo Matias Date: Mon, 16 Mar 2020 23:40:20 -0300 Subject: [PATCH] Allow user to specify grafana_server_fqdn This is needed to get a TLS certificate to validate correctly. If unspecified, auto-detected grafana_server_addr is used. Signed-off-by: Paulo Matias (cherry picked from commit 38ce02c2eacee20395b4d7ad6fc5b7b2c4470a30) --- group_vars/all.yml.sample | 2 ++ group_vars/rhcs.yml.sample | 2 ++ roles/ceph-dashboard/tasks/configure_grafana_layouts.yml | 2 +- roles/ceph-defaults/defaults/main.yml | 2 ++ 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/group_vars/all.yml.sample b/group_vars/all.yml.sample index 39e75e239..1fa164d31 100644 --- a/group_vars/all.yml.sample +++ b/group_vars/all.yml.sample @@ -762,6 +762,8 @@ dummy: #grafana_crt: '' #grafana_key: '' #grafana_container_image: "grafana/grafana:5.4.3" +# When using https, please fill with a hostname for which grafana_crt is valid. +#grafana_server_fqdn: '' #grafana_container_cpu_period: 100000 #grafana_container_cpu_cores: 2 # container_memory is in GB diff --git a/group_vars/rhcs.yml.sample b/group_vars/rhcs.yml.sample index c6231cab9..6c09dda99 100644 --- a/group_vars/rhcs.yml.sample +++ b/group_vars/rhcs.yml.sample @@ -762,6 +762,8 @@ node_exporter_container_image: registry.redhat.io/openshift4/ose-prometheus-node #grafana_crt: '' #grafana_key: '' grafana_container_image: registry.redhat.io/rhceph/rhceph-4-dashboard-rhel8:4 +# When using https, please fill with a hostname for which grafana_crt is valid. +#grafana_server_fqdn: '' #grafana_container_cpu_period: 100000 #grafana_container_cpu_cores: 2 # container_memory is in GB diff --git a/roles/ceph-dashboard/tasks/configure_grafana_layouts.yml b/roles/ceph-dashboard/tasks/configure_grafana_layouts.yml index 00e8eaacd..556c5870c 100644 --- a/roles/ceph-dashboard/tasks/configure_grafana_layouts.yml +++ b/roles/ceph-dashboard/tasks/configure_grafana_layouts.yml @@ -1,6 +1,6 @@ --- - name: set grafana url - command: "{{ container_exec_cmd }} ceph --cluster {{ cluster }} dashboard set-grafana-api-url {{ dashboard_protocol }}://{{ grafana_server_addr }}:{{ grafana_port }}" + command: "{{ container_exec_cmd }} ceph --cluster {{ cluster }} dashboard set-grafana-api-url {{ dashboard_protocol }}://{{ grafana_server_fqdn | default(grafana_server_addr, true) }}:{{ grafana_port }}" delegate_to: "{{ groups[mon_group_name][0] }}" run_once: true changed_when: false diff --git a/roles/ceph-defaults/defaults/main.yml b/roles/ceph-defaults/defaults/main.yml index 680ccc7a9..ad753300d 100644 --- a/roles/ceph-defaults/defaults/main.yml +++ b/roles/ceph-defaults/defaults/main.yml @@ -754,6 +754,8 @@ grafana_admin_user: admin grafana_crt: '' grafana_key: '' grafana_container_image: "grafana/grafana:5.4.3" +# When using https, please fill with a hostname for which grafana_crt is valid. +grafana_server_fqdn: '' grafana_container_cpu_period: 100000 grafana_container_cpu_cores: 2 # container_memory is in GB