From f78981bbf786a44dfc77f7e51599a12023822e6f Mon Sep 17 00:00:00 2001 From: Dimitri Savineau Date: Wed, 12 Feb 2020 10:38:25 -0500 Subject: [PATCH] ceph-grafana: fix grafana_{crt,key} condition The grafana_{crt,key} aren't boolean variables but strings. The default value is an empty string so we should do the conditional on the string length instead of the bool filter Closes: #5053 Signed-off-by: Dimitri Savineau (cherry picked from commit 15bd4cd189d0c4009bcd9dd80b296492e336661e) --- roles/ceph-grafana/tasks/configure_grafana.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/roles/ceph-grafana/tasks/configure_grafana.yml b/roles/ceph-grafana/tasks/configure_grafana.yml index 682d1411f..f38eb1c1c 100644 --- a/roles/ceph-grafana/tasks/configure_grafana.yml +++ b/roles/ceph-grafana/tasks/configure_grafana.yml @@ -76,7 +76,7 @@ group: "{{ grafana_uid }}" mode: 0640 when: - - grafana_crt | bool + - grafana_crt | length > 0 - dashboard_protocol == "https" - name: copy grafana SSL certificate key @@ -87,7 +87,7 @@ group: "{{ grafana_uid }}" mode: 0440 when: - - grafana_key | bool + - grafana_key | length > 0 - dashboard_protocol == "https" - name: generate a Self Signed OpenSSL certificate for dashboard @@ -97,7 +97,7 @@ chown {{ grafana_uid }}:{{ grafana_uid }} /etc/grafana/ceph-dashboard.key /etc/grafana/ceph-dashboard.crt) when: - dashboard_protocol == "https" - - not grafana_key | bool or not grafana_crt | bool + - grafana_key | length == 0 or grafana_crt | length == 0 - name: enable and start grafana service: