---
- include: targets/nxos_install_os/tasks/upgrade/delete_files_provider.yaml
  when: delete_image_list is defined

- include: targets/nxos_install_os/tasks/upgrade/copy_kick_system_images.yaml

- include: targets/nxos_install_os/tasks/upgrade/install_with_kick_provider.yaml
  when: ki is defined and combined is undefined

- include: targets/nxos_install_os/tasks/upgrade/install_system_provider.yaml
  when: combined is defined

# Only needed when - meta: reset_connection does not work. Fixed in 2.6
#- include: targets/nxos_install_os/tasks/upgrade/clear_persistent_sockets.yaml

- meta: reset_connection

- name: "Check installed OS for newly installed version {{ tv }}"
  nxos_command:
    commands: ['show version | json']
    provider: "{{ connection }}"
  register: output

- debug: msg="Version detected {{ output['stdout_lines'][0]['kickstart_ver_str'] }}"
