---
# tasks file for tripleo-upgrade

- block:
    - name: prepare workload scripts
      include: common/create_workload.yml

    - name: launch workload
      command: "{{ workload_launch_script }}"

  when: workload_launch|bool

- include: upgrade/main.yml
  when: upgrade_noop|bool or undercloud_upgrade|bool or overcloud_upgrade|bool

- include: update/main.yml
  when: update_noop|bool or undercloud_update|bool or overcloud_update|bool

- include: fast-forward-upgrade/main.yml
  when: ffu_noop|bool or ffu_undercloud_upgrade|bool or ffu_overcloud_upgrade|bool

- name: workload cleanup
  shell: |
    set -o pipefail
    bash {{ workload_launch_script }} cleanup 2>&1 {{ timestamper_cmd }} > workload_cleanup.log
  args:
    chdir: "{{ working_dir }}"
  when: workload_cleanup|bool
