cisco.nxos.nxos_install_os (7.0.0) — module

Set boot options like boot, kickstart image and issu.

| "added in version" 1.0.0 of cisco.nxos"

Authors: Jason Edelman (@jedelman8), Gabriele Gerbibo (@GGabriele)

Install collection

Install with ansible-galaxy collection install cisco.nxos:==7.0.0


Add to requirements.yml

  collections:
    - name: cisco.nxos
      version: 7.0.0

Description

Install an operating system by setting the boot options like boot image and kickstart image and optionally select to install using ISSU (In Server Software Upgrade).

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Install OS on N9k
  check_mode: false
  cisco.nxos.nxos_install_os:
    system_image_file: nxos.7.0.3.I6.1.bin
    issu: desired
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Wait for device to come back up with new image
  wait_for:
    port: 22
    state: started
    timeout: 500
    delay: 60
    host: '{{ inventory_hostname }}'
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Check installed OS for newly installed version
  nxos_command:
    commands: [show version | json]
  register: output
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- assert:
    that:
      - output['stdout'][0]['kickstart_ver_str'] == '7.0(3)I6(1)'

Inputs

    
issu:
    choices:
    - required
    - desired
    - 'yes'
    - 'no'
    default: 'no'
    description:
    - Upgrade using In Service Software Upgrade (ISSU). (Supported on N5k, N7k, N9k platforms)
    - Selecting 'required' or 'yes' means that upgrades will only proceed if the switch
      is capable of ISSU.
    - Selecting 'desired' means that upgrades will use ISSU if possible but will fall
      back to disruptive upgrade if needed.
    - Selecting 'no' means do not use ISSU. Forced disruptive.
    type: str

system_image_file:
    description:
    - Name of the system (or combined) image file on flash.
    required: true
    type: str

kickstart_image_file:
    description:
    - Name of the kickstart image file on flash. (Not required on all Nexus platforms)
    type: str

Outputs

install_state:
  description: Boot and install information.
  returned: always
  sample:
    install_state:
    - 'Compatibility check is done:'
    - Module  bootable          Impact  Install-type  Reason
    - '------  --------  --------------  ------------  ------'
    - '     1       yes  non-disruptive         reset  '
    - 'Images will be upgraded according to following table:'
    - Module       Image                  Running-Version(pri:alt)           New-Version  Upg-Required
    - '------  ----------  ----------------------------------------  --------------------  ------------'
    - '     1        nxos                               7.0(3)I6(1)           7.0(3)I7(1)           yes'
    - '     1        bios                        v4.4.0(07/12/2017)    v4.4.0(07/12/2017)            no'
  type: dict