Remove the legacy cache creation process
This change removes the legacy cache creation process which was used to provide compatibility until the needed changes were merged into the lxc container create role. Because everything needed is now upstream as found here: [0] the legacy cache task has been removed. This change also addresses an Ansible lint issue by moving the existing cache cleanup task to an idempotent one. [0] - https://review.openstack.org/#/c/311796/ Change-Id: I2950348c99e4eca7c0205d8674d77393816debe8 Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
This commit is contained in:
parent
50ded911a5
commit
8d982fae4c
@ -13,9 +13,18 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
- name: Remove existing cache archive
|
||||
file:
|
||||
path: "{{ lxc_container_cache_path }}/{{ lxc_cache_map.distro }}/{{ lxc_cache_map.release }}/{{ lxc_cache_map.arch }}/default/rootfs.tar.xz"
|
||||
state: "absent"
|
||||
tags:
|
||||
- lxc-cache
|
||||
- lxc-image-cache-create
|
||||
|
||||
# This is using a shell command because the ansible archive module does not
|
||||
# provide for the options needed to properly create an LXC image archive.
|
||||
- name: Create lxc image
|
||||
shell: |
|
||||
rm {{ lxc_container_cache_path }}/{{ lxc_cache_map.distro }}/{{ lxc_cache_map.release }}/{{ lxc_cache_map.arch }}/default/rootfs.tar.xz
|
||||
tar -Opc -C /var/lib/lxc/cache-{{ lxc_cache_map.distro }}/rootfs . | xz -{{ 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/"
|
||||
@ -23,14 +32,3 @@
|
||||
tags:
|
||||
- lxc-cache
|
||||
- lxc-image-cache-create
|
||||
|
||||
# TODO(cloudnull) This should be removed just as soon as the lxc-container create
|
||||
# play supports using the download template instead of the distro specific one.
|
||||
- name: Create LEGACY LXC container cache
|
||||
shell: |
|
||||
mkdir -p /var/cache/lxc/{{ lxc_cache_map.release }}
|
||||
cp -R /var/lib/lxc/cache-{{ lxc_cache_map.distro }}/rootfs /var/cache/lxc/{{ lxc_cache_map.release }}/rootfs-amd64
|
||||
notify: Destroy base container
|
||||
tags:
|
||||
- lxc-cache
|
||||
- lxc-legacy-image-cache-create
|
||||
|
Loading…
Reference in New Issue
Block a user