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>
- 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/"