---
- debug: msg="START connection={{ ansible_connection }} nxos_os_install upgrade"
- debug: msg="Using provider={{ connection.transport }}"
  when: connection is defined

# Set directory pointer to software images
- set_fact: image_dir='/auto/fe_ssr/agents-ci/agents_images/release_images/hamilton/REL_9_2_1/'

- set_fact: checkmode='no'
- set_fact: issu='desired'
- set_fact: copy_images=True

# Set boot pointers and reload
- set_fact: force=False

- set_fact: delete_files=True
- set_fact:
    delete_image_list:
      - nxos*.bin

#---------------------------------------------------------#
# Remove incompatible features                            #
#---------------------------------------------------------#
- name: Unconfigure features that will conflict with upgrade
  nxos_config:
    lines:
      - terminal dont-ask
      - no feature ngmvpn
    match: none
    provider: "{{ connection }}"
  ignore_errors: yes

#---------------------------------------------------------#
# Upgrade Device                                          #
#---------------------------------------------------------#
- set_fact: si='nxos.9.2.1.bin'

- name: Upgrade N9k Device to Hamilton Release Image
  include: targets/nxos_install_os/tasks/upgrade/main_os_install.yaml
