]> git-server-git.apps.pok.os.sepia.ceph.com Git - cephmetrics.git/commitdiff
ceph-dashboard: Add timeout to rgw user create
authorBoris Ranto <branto@redhat.com>
Tue, 27 Nov 2018 12:30:24 +0000 (13:30 +0100)
committerBoris Ranto <branto@redhat.com>
Wed, 28 Nov 2018 13:01:31 +0000 (14:01 +0100)
This avoids the playbook to hang indefinitely on the radosgw-admin user
create command. The playbook will still fail if the command hangs but it
is better to fail than to hang forever.

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

index 95246cc2e2c1ca883b8210c2d1083e953ce527cc..32908d02d3c7e299090cf1258a18600bdac3a0c4 100644 (file)
   command: "{{ mgr_prefix }} ceph dashboard set-grafana-api-url {{ protocol }}://{{ groups['ceph-grafana'][0] }}:3000/"
 
 - name: Create radosgw system user
-  command: "{{ mgr_prefix }} radosgw-admin user create --uid={{ dashboard.rgw_api_user_id }} --display-name='Ceph dashboard' --system"
+  shell: "timeout 20 {{ mgr_prefix }} radosgw-admin user create --uid={{ dashboard.rgw_api_user_id }} --display-name='Ceph dashboard' --system"
   register: rgw_user_output
+  until: rgw_user_output.rc == 0
+  retries: 3
 
 - name: Get the rgw access and secret keys
   set_fact: