From bc6777c6df3c528c3979936555f7dc35a59ef13c Mon Sep 17 00:00:00 2001 From: Guillaume Abrioux Date: Tue, 28 Jan 2020 15:32:27 +0100 Subject: [PATCH] dashboard: add quotes when passing password to the CLI Otherwise, if the variables contains a '$' it will be interpreted as a BASH variable. Signed-off-by: Guillaume Abrioux (cherry picked from commit 8c3759f8ce04a4c2df673290197ef12fe98d992a) --- roles/ceph-dashboard/tasks/configure_dashboard.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/roles/ceph-dashboard/tasks/configure_dashboard.yml b/roles/ceph-dashboard/tasks/configure_dashboard.yml index 8ab845195..b9249100e 100644 --- a/roles/ceph-dashboard/tasks/configure_dashboard.yml +++ b/roles/ceph-dashboard/tasks/configure_dashboard.yml @@ -81,10 +81,10 @@ - name: set or update dashboard admin username and password shell: | - if {{ container_exec_cmd }} ceph --cluster {{ cluster }} dashboard ac-user-show {{ dashboard_admin_user }}; then - {{ container_exec_cmd }} ceph --cluster {{ cluster }} dashboard ac-user-set-password {{ dashboard_admin_user }} {{ dashboard_admin_password }} + if {{ container_exec_cmd }} ceph --cluster {{ cluster }} dashboard ac-user-show {{ dashboard_admin_user | quote }}; then + {{ container_exec_cmd }} ceph --cluster {{ cluster }} dashboard ac-user-set-password {{ dashboard_admin_user | quote }} {{ dashboard_admin_password | quote }} else - {{ container_exec_cmd }} ceph --cluster {{ cluster }} dashboard ac-user-create {{ dashboard_admin_user }} {{ dashboard_admin_password }} administrator + {{ container_exec_cmd }} ceph --cluster {{ cluster }} dashboard ac-user-create {{ dashboard_admin_user | quote }} {{ dashboard_admin_password | quote }} administrator fi retries: 6 delay: 5 -- 2.39.5