cisco.nxos.nxos_gir (7.0.0) — module

Trigger a graceful removal or insertion (GIR) of the switch.

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

Authors: Gabriele Gerbino (@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

Trigger a graceful removal or insertion (GIR) of the switch.

GIR processing may take more than 2 minutes. Timeout settings are automatically extended to 200s when user timeout settings are insufficient.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Trigger system maintenance mode
- cisco.nxos.nxos_gir:
    system_mode_maintenance: true
    host: '{{ inventory_hostname }}'
    username: '{{ un }}'
    password: '{{ pwd }}'
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Trigger system normal mode
- cisco.nxos.nxos_gir:
    system_mode_maintenance: false
    host: '{{ inventory_hostname }}'
    username: '{{ un }}'
    password: '{{ pwd }}'
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Configure on-reload reset-reason for maintenance mode
- cisco.nxos.nxos_gir:
    system_mode_maintenance_on_reload_reset_reason: manual_reload
    state: present
    host: '{{ inventory_hostname }}'
    username: '{{ un }}'
    password: '{{ pwd }}'
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Add on-reload reset-reason for maintenance mode
- cisco.nxos.nxos_gir:
    system_mode_maintenance_on_reload_reset_reason: hw_error
    state: present
    host: '{{ inventory_hostname }}'
    username: '{{ un }}'
    password: '{{ pwd }}'
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Remove on-reload reset-reason for maintenance mode
- cisco.nxos.nxos_gir:
    system_mode_maintenance_on_reload_reset_reason: manual_reload
    state: absent
    host: '{{ inventory_hostname }}'
    username: '{{ un }}'
    password: '{{ pwd }}'
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Set timeout for maintenance mode
- cisco.nxos.nxos_gir:
    system_mode_maintenance_timeout: 30
    state: present
    host: '{{ inventory_hostname }}'
    username: '{{ un }}'
    password: '{{ pwd }}'
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Remove timeout for maintenance mode
- cisco.nxos.nxos_gir:
    system_mode_maintenance_timeout: 30
    state: absent
    host: '{{ inventory_hostname }}'
    username: '{{ un }}'
    password: '{{ pwd }}'

Inputs

    
state:
    choices:
    - present
    - absent
    default: present
    description:
    - Specify desired state of the resource.
    type: str

system_mode_maintenance:
    description:
    - When C(system_mode_maintenance=true) it puts all enabled protocols in maintenance
      mode (using the isolate command). When C(system_mode_maintenance=false) it puts
      all enabled protocols in normal mode (using the no isolate command).
    type: bool

system_mode_maintenance_timeout:
    description:
    - Keeps the switch in maintenance mode for a specified number of minutes. Range is
      5-65535.
    type: str

system_mode_maintenance_shutdown:
    description:
    - Shuts down all protocols, vPC domains, and interfaces except the management interface
      (using the shutdown command). This option is disruptive while C(system_mode_maintenance)
      (which uses the isolate command) is not.
    type: bool

system_mode_maintenance_dont_generate_profile:
    description:
    - When C(system_mode_maintenance_dont_generate_profile=true) it prevents the dynamic
      searching of enabled protocols and executes commands configured in a maintenance-mode
      profile. Use this option if you want the system to use a maintenance-mode profile
      that you have created. When C(system_mode_maintenance_dont_generate_profile=false)
      it prevents the dynamic searching of enabled protocols and executes commands configured
      in a normal-mode profile. Use this option if you want the system to use a normal-mode
      profile that you have created.
    type: bool

system_mode_maintenance_on_reload_reset_reason:
    choices:
    - hw_error
    - svc_failure
    - kern_failure
    - wdog_timeout
    - fatal_error
    - lc_failure
    - match_any
    - manual_reload
    - any_other
    - maintenance
    description:
    - Boots the switch into maintenance mode automatically in the event of a specified
      system crash. Note that not all reset reasons are applicable for all platforms.
      Also if reset reason is set to match_any, it is not idempotent as it turns on all
      reset reasons. If reset reason is match_any and state is absent, it turns off all
      the reset reasons.
    type: str

Outputs

changed:
  description: check to see if a change was made on the device
  returned: always
  sample: true
  type: bool
final_system_mode:
  description: describe the last system mode
  returned: verbose mode
  sample: normal
  type: str
updates:
  description: commands sent to the device
  returned: verbose mode
  sample:
  - terminal dont-ask
  - system mode maintenance timeout 10
  type: list