From: Boris Ranto Date: Thu, 29 Nov 2018 15:50:03 +0000 (+0100) Subject: Try creating the ansible user with delay X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=45df2b39494bf047c61ce6461165571492b473f2;p=cephmetrics.git Try creating the ansible user with delay 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 --- diff --git a/ansible/roles/ceph-dashboard/tasks/configure_dashboard.yml b/ansible/roles/ceph-dashboard/tasks/configure_dashboard.yml index 32908d0..e002d98 100644 --- a/ansible/roles/ceph-dashboard/tasks/configure_dashboard.yml +++ b/ansible/roles/ceph-dashboard/tasks/configure_dashboard.yml @@ -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 @@ -88,6 +85,10 @@ 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/"