]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
dashboard: add quotes when passing password to the CLI
authorGuillaume Abrioux <gabrioux@redhat.com>
Tue, 28 Jan 2020 14:32:27 +0000 (15:32 +0100)
committerGuillaume Abrioux <gabrioux@redhat.com>
Wed, 29 Jan 2020 13:15:41 +0000 (14:15 +0100)
Otherwise, if the variables contains a '$' it will be interpreted as a BASH
variable.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit 8c3759f8ce04a4c2df673290197ef12fe98d992a)

roles/ceph-dashboard/tasks/configure_dashboard.yml

index 8ab84519537f2cabb45a3f0d632af58923714c2d..b9249100ee3a7c7806d0b13a345dce7bf73defdb 100644 (file)
 
 - 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