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 <dsavinea@redhat.com>
(cherry picked from commit 15bd4cd189)
pull/5081/head
Dimitri Savineau 2020-02-12 10:38:25 -05:00 committed by Dimitri Savineau
parent a9a533e398
commit f78981bbf7
1 changed files with 3 additions and 3 deletions

View 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: