]> git-server-git.apps.pok.os.sepia.ceph.com Git - cephmetrics.git/commitdiff
Try creating the ansible user with delay
authorBoris Ranto <branto@redhat.com>
Thu, 29 Nov 2018 15:50:03 +0000 (16:50 +0100)
committerBoris Ranto <branto@redhat.com>
Thu, 29 Nov 2018 15:52:09 +0000 (16:52 +0100)
It can take a while until the mgr daemon is up, especially when it is
running on a different node. This will try creating the ansible user 7
times with 5 second delays in between. It safer than just sleeping
before the command.

Signed-off-by: Boris Ranto <branto@redhat.com>
ansible/roles/ceph-dashboard/tasks/configure_dashboard.yml

index 32908d02d3c7e299090cf1258a18600bdac3a0c4..e002d986e257bbd540fda204244bcf6cb87335be 100644 (file)
@@ -78,9 +78,6 @@
 - name: Enable mgr dashboard module (restart)
   command: "{{ mgr_prefix }} ceph mgr module enable dashboard"
 
-- name: Wait a while for mgr module to come up
-  command: "sleep 3"
-
 - name: Set or update dashboard admin username and password
   shell: |
     if {{ mgr_prefix }} ceph dashboard ac-user-show {{ dashboard.admin_user }}; then
     else
       {{ mgr_prefix }} ceph dashboard ac-user-create {{ dashboard.admin_user }} {{ dashboard.admin_password }} administrator
     fi
+  retries: 6
+  delay: 5
+  register: ac_result
+  until: ac_result.rc == 0
 
 - name: Set grafana url
   command: "{{ mgr_prefix }} ceph dashboard set-grafana-api-url {{ protocol }}://{{ groups['ceph-grafana'][0] }}:3000/"