--- - import_tasks: detect_project.yml when: osp_project_id is not defined # If project exists - when: >- osp_project_info | default([]) | length > 0 or osp_project_id is defined block: - when: osp_project_create | bool include_tasks: project_resources.yml # Delete the heat stack **after** resources: # The heat stack creates resources like network and router. # Over the course of the lifetime of a project, users may # create instances, ports, etc. that are outside of the heat # stack. If you try to tear the heat stack down without deleting # those extra ports, for instance, the heat stack teardown will fail. - include_tasks: heat.yml - when: osp_project_create | bool name: Delete the project include_tasks: project.yml # If project doesn't exist - when: - osp_project_info | default([]) | length == 0 - osp_project_id is not defined debug: msg: "No project found for {{ osp_project_name }}. Nothing done."