From dce34c0b872d14c97edc311ef1b5e341e4b85a46 Mon Sep 17 00:00:00 2001 From: Jonathan Rosser Date: Wed, 4 Oct 2017 20:51:33 +0100 Subject: [PATCH] Allow container creation on ZFS backing storage Add a conditional task to create the base container on ZFS backing storage. Change-Id: Id6871f37aa2e7729d42acc0233ccd057706d8d24 --- tasks/lxc_cache_create.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tasks/lxc_cache_create.yml b/tasks/lxc_cache_create.yml index 0d20fd13..8fe3f140 100644 --- a/tasks/lxc_cache_create.yml +++ b/tasks/lxc_cache_create.yml @@ -107,3 +107,19 @@ - lxc_container_backing_store == 'lvm' - lxc_container_backing_method is defined - lxc_container_backing_method == 'copy-on-write' + +- name: Create base container to use for ZFS-backed containers + lxc_container: + name: "{{ lxc_container_base_name }}" + template: "download" + state: stopped + backing_store: "zfs" + zfs_root: "{{ lxc_container_zfs_root_name }}" + template_options: "{{ lxc_cache_download_template_options }}" + register: cache_download + retries: 3 + delay: 10 + until: cache_download|success + when: + - lxc_container_backing_store is defined + - lxc_container_backing_store == 'zfs'