Use wait_for instead of sleep to fetch keyring 45/6945/3
authorgrakiss <grakiss.wanglei@huawei.com>
Sat, 16 Jan 2016 07:56:31 +0000 (15:56 +0800)
committerJustin chi <chigang@huawei.com>
Mon, 18 Jan 2016 14:19:07 +0000 (14:19 +0000)
JIRA: COMPASS-275
  - fetch is not reliable, and sleep is also not reliable
  - wait_for can be used to confirm the file existence

Change-Id: Ie44715e1b8756398f656fdee2c3243f03967e29a
Signed-off-by: grakiss <grakiss.wanglei@huawei.com>
deploy/adapters/ansible/roles/ceph-mon/tasks/install_mon.yml

index e2fc8eb..1bdf3bf 100644 (file)
@@ -14,8 +14,8 @@
 - name: auto start ceph-mon
   file: path="/var/lib/ceph/mon/ceph-{{ inventory_hostname }}/upstart" state="touch"
 
-- name: sleep for creating osd keyring
-  shell: sleep 10 
+- name: wait for creating osd keyring
+  wait_for: path=/var/lib/ceph/bootstrap-osd/ceph.keyring
 
 - name: fetch osd keyring
   fetch: src="/var/lib/ceph/bootstrap-osd/ceph.keyring" dest="/tmp/ceph.osd.keyring" flat=yes