summaryrefslogtreecommitdiffstats
path: root/compass/deploy/ansible/roles/glance/tasks/glance_config.yml
diff options
context:
space:
mode:
authorcarey.xu <carey.xuhan@huawei.com>2015-06-30 14:53:17 +0800
committercarey.xu <carey.xuhan@huawei.com>2015-06-30 14:53:17 +0800
commitd6e99bb0819b1e0675ea642fd81f5bfcd568ebfb (patch)
treef620c37edc195695d3b53f567c250d150e933cdd /compass/deploy/ansible/roles/glance/tasks/glance_config.yml
parent5847a0f09e22d19eaa8590fdb3b3eb3d6fa2a51b (diff)
update ansible roles directory for supporting commpass-core installing
BGS-80 Change-Id: I97a5d2a9b1f6c799c1976ec1cf6e687b108e0d0f Signed-off-by: carey.xu <carey.xuhan@huawei.com>
Diffstat (limited to 'compass/deploy/ansible/roles/glance/tasks/glance_config.yml')
-rw-r--r--compass/deploy/ansible/roles/glance/tasks/glance_config.yml29
1 files changed, 29 insertions, 0 deletions
diff --git a/compass/deploy/ansible/roles/glance/tasks/glance_config.yml b/compass/deploy/ansible/roles/glance/tasks/glance_config.yml
new file mode 100644
index 0000000..28392a3
--- /dev/null
+++ b/compass/deploy/ansible/roles/glance/tasks/glance_config.yml
@@ -0,0 +1,29 @@
+---
+- name: init glance db version
+ shell: glance-manage db_version_control 0
+
+- name: sync glance db
+ shell: sleep 15; su -s /bin/sh -c "glance-manage db_sync" glance
+ register: result
+ until: result.rc == 0
+ retries: 5
+ delay: 3
+ notify:
+ - restart glance-registry
+ - restart glance-api
+
+- meta: flush_handlers
+
+- name: place image upload script
+ template: src=image_upload.sh dest=/opt/image_upload.sh mode=0744
+
+- name: download cirros image file
+ get_url: url={{ build_in_image }} dest=/opt/{{ build_in_image_name }}
+
+- name: wait for 9292 port to become available
+ wait_for: host={{ image_host }} port=9292 delay=5
+
+- name: run image upload
+ shell: for i in {0..5}; do /opt/image_upload.sh && touch image_upload_completed; if [ $? != 0 ] ;then sleep 5; else break;fi;done
+ args:
+ creates: image_upload_completed