- name: Create the working directory if it doesn't exist
  file:
    path: "{{ working_dir }}"
    state: directory
    mode: 0755

# Get the base image and setup repos
- include: repo_setup.yml

# Install packages for overcloud base image
- include: package_install.yml

# Use overcloud base image to create undercloud base image
- include: convert_undercloud.yml

# Use DIB to build the overlcloud-full and IPA images
- include: dib_build.yml

# Inject overcloud-full and IPA images into the undercloud image
- include: undercloud_inject.yml
- name: Delete prior working directory if present
  file:
    path: "{{ working_dir }}"
    state: absent

- name: Create the working directory
  file:
    path: "{{ working_dir }}"
    state: directory
    mode: 0755

# Get the base image and setup repos
- include: repo_setup.yml

# Install packages for overcloud base image
- include: package_install.yml

# Use overcloud base image to create undercloud base image
- include: convert_undercloud.yml

# Use DIB to build the overlcloud-full and IPA images
- include: dib_build.yml

# Inject overcloud-full and IPA images into the undercloud image
- include: undercloud_inject.yml
Delete the working directory (and it's debris) prior to creating it.
Delete the working directory (and it's debris) prior to creating it.

Without this we don't start from a known/clean state when building images.
If images exist, virt-customize passes may fail as they are operating on a
previous run's output.

Change-Id: Id30ae4a8ff786464874549afa157c13c3cd35424
