---
- name: create FFU role ugrades scripts
  template:
    src: fast-forward-upgrade/overcloud_upgrade_role.sh.j2
    dest: "{{ working_dir }}/overcloud_upgrade_{{ item }}.sh"
    mode: 0775
  tags: ffu_overcloud_upgrade
  loop:
    - "all"

- name: apply pre overcloud upgrade run workarounds
  command: "{{ working_dir }}/pre_ffu_overcloud_upgrade_workarounds.sh"
  when: ffu_upgrade_workarounds|bool
  tags: ffu_overcloud_upgrade

- name: import ../common/l3_agent_connectivity_check_start_script tasks
  import_tasks: ../common/l3_agent_connectivity_check_start_script.yml
  tags: ffu_overcloud_upgrade

- name: run all roles upgrade steps
  command: "{{ working_dir }}//overcloud_upgrade_all.sh"
  tags: ffu_overcloud_upgrade

- name: include L3 connectivity tasks
  include_tasks: "{{ item }}"
  args:
    apply:
      tags: ffu_overcloud_upgrade
  loop:
    - '../common/l3_agent_connectivity_check_stop_script.yml'
    - '../common/l3_agent_failover_check_post_script.yml'
  tags: ffu_overcloud_upgrade
