]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
ceph-grafana: fix grafana_{crt,key} condition
authorDimitri Savineau <dsavinea@redhat.com>
Wed, 12 Feb 2020 15:38:25 +0000 (10:38 -0500)
committerDimitri Savineau <savineau.dimitri@gmail.com>
Mon, 17 Feb 2020 15:18:39 +0000 (10:18 -0500)
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 <dsavinea@redhat.com>
(cherry picked from commit 15bd4cd189d0c4009bcd9dd80b296492e336661e)

roles/ceph-grafana/tasks/configure_grafana.yml

index 682d1411fb1bba1649fdfa6e19b91662941aa0e8..f38eb1c1cd0972df1fe41cd13fff7c6df9c7ce39 100644 (file)
@@ -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: