summaryrefslogtreecommitdiffstats
path: root/playbooks/libvirt/openshift-cluster/tasks
diff options
context:
space:
mode:
authorAkram Ben Aissi <akram@free.fr>2015-12-17 17:38:30 +0100
committerAkram Ben Aissi <akram@free.fr>2016-02-03 10:11:23 +0100
commit903de6ce16399c532e86fa061fa402194c62bd5f (patch)
treea5a5ee15dd88ea2d6adcb70ed109a9d1e5a4b8ec /playbooks/libvirt/openshift-cluster/tasks
parentfda67ef2addee2cb4cb982c8b9e0eb13bcf9ff7e (diff)
downloadopenshift-903de6ce16399c532e86fa061fa402194c62bd5f.tar.gz
openshift-903de6ce16399c532e86fa061fa402194c62bd5f.tar.bz2
openshift-903de6ce16399c532e86fa061fa402194c62bd5f.tar.xz
openshift-903de6ce16399c532e86fa061fa402194c62bd5f.zip
Allow compression option to be set to empty for non compressed QCow images
Support tgz and gzip compressed images
Diffstat (limited to 'playbooks/libvirt/openshift-cluster/tasks')
-rw-r--r--playbooks/libvirt/openshift-cluster/tasks/launch_instances.yml16
1 files changed, 14 insertions, 2 deletions
diff --git a/playbooks/libvirt/openshift-cluster/tasks/launch_instances.yml b/playbooks/libvirt/openshift-cluster/tasks/launch_instances.yml
index ff1cedc94..ebe9f0ad9 100644
--- a/playbooks/libvirt/openshift-cluster/tasks/launch_instances.yml
+++ b/playbooks/libvirt/openshift-cluster/tasks/launch_instances.yml
@@ -13,16 +13,28 @@
get_url:
url: '{{ image_url }}'
sha256sum: '{{ image_sha256 }}'
- dest: '{{ os_libvirt_storage_pool_path }}/{{ [image_name, image_compression] | join(".") }}'
+ dest: '{{ os_libvirt_storage_pool_path }}/{{ [image_name, image_compression] | reject("equalto", "") | join(".") }}'
when: '{{ ( lookup("oo_option", "skip_image_download") | default("no", True) | lower ) in ["false", "no"] }}'
register: downloaded_image
-- name: Uncompress Base Cloud image
+- name: Uncompress xz compressed base cloud image
command: 'unxz -kf {{ os_libvirt_storage_pool_path }}/{{ [image_name, image_compression] | join(".") }}'
args:
creates: '{{ os_libvirt_storage_pool_path }}/{{ image_name }}'
when: image_compression in ["xz"] and downloaded_image.changed
+- name: Uncompress tgz compressed base cloud image
+ command: 'tar zxvf {{ os_libvirt_storage_pool_path }}/{{ [image_name, image_compression] | join(".") }}'
+ args:
+ creates: '{{ os_libvirt_storage_pool_path }}/{{ image_name }}'
+ when: image_compression in ["tgz"] and downloaded_image.changed
+
+- name: Uncompress gzip compressed base cloud image
+ command: 'gunzip {{ os_libvirt_storage_pool_path }}/{{ [image_name, image_compression] | join(".") }}'
+ args:
+ creates: '{{ os_libvirt_storage_pool_path }}/{{ image_name }}'
+ when: image_compression in ["gz"] and downloaded_image.changed
+
- name: Create the cloud-init config drive path
file:
dest: '{{ os_libvirt_storage_pool_path }}/{{ item }}_configdrive/'