Compress base container using parallel xz

The package for pxz is installed but was not being used, so
the base container compression was only using 1 core during
compression. This change allows pxz to be used which will
compress much faster when multiple cores are available.

Change-Id: I7eee214a69762b36c9bb2b23edad5688189bb967
This commit is contained in:
Logan V 2016-09-03 17:58:01 -05:00
parent 812e72b7b2
commit b9152b925c
4 changed files with 7 additions and 1 deletions

View File

@ -25,7 +25,7 @@
# provide for the options needed to properly create an LXC image archive.
- name: Create lxc image
shell: |
tar -Opc -C /var/lib/lxc/LXC_NAME/rootfs . | xz -{{ lxc_image_compression_ratio }} -c - > rootfs.tar.xz
tar -Opc -C /var/lib/lxc/LXC_NAME/rootfs . | {{ lxc_xz_bin }} -{{ lxc_image_compression_ratio }} -c - > rootfs.tar.xz
args:
chdir: "{{ lxc_container_cache_path }}/{{ lxc_cache_map.distro }}/{{ lxc_cache_map.release }}/{{ lxc_cache_map.arch }}/default/"
notify: Destroy base container

View File

@ -39,6 +39,8 @@ lxc_hosts_distro_packages:
- redhat-lsb
- xz
lxc_xz_bin: xz
lxc_cache_map:
distro: centos
arch: amd64

View File

@ -36,6 +36,8 @@ lxc_hosts_distro_packages:
- python3-lxc
- pxz
lxc_xz_bin: pxz
system_config_dir: "/etc/default"
lxc_cache_map:
distro: ubuntu

View File

@ -37,6 +37,8 @@ lxc_hosts_distro_packages:
- python3-lxc
- pxz
lxc_xz_bin: pxz
system_config_dir: "/etc/default"
lxc_cache_map:
distro: ubuntu