Skip to content

Latest commit

 

History

History
302 lines (270 loc) · 12.7 KB

cisco.nxos.nxos_gir_module.rst

File metadata and controls

302 lines (270 loc) · 12.7 KB

cisco.nxos.nxos_gir

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

Version added: 1.0.0

  • 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.
Parameter Choices/Defaults Comments
state
string
    Choices:
  • present ←
  • absent
Specify desired state of the resource.
system_mode_maintenance
boolean
    Choices:
  • no
  • yes
When system_mode_maintenance=true it puts all enabled protocols in maintenance mode (using the isolate command). When system_mode_maintenance=false it puts all enabled protocols in normal mode (using the no isolate command).
system_mode_maintenance_dont_generate_profile
boolean
    Choices:
  • no
  • yes
When 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 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.
system_mode_maintenance_on_reload_reset_reason
string
    Choices:
  • hw_error
  • svc_failure
  • kern_failure
  • wdog_timeout
  • fatal_error
  • lc_failure
  • match_any
  • manual_reload
  • any_other
  • maintenance
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.
system_mode_maintenance_shutdown
boolean
    Choices:
  • no
  • yes
Shuts down all protocols, vPC domains, and interfaces except the management interface (using the shutdown command). This option is disruptive while system_mode_maintenance (which uses the isolate command) is not.
system_mode_maintenance_timeout
string
Keeps the switch in maintenance mode for a specified number of minutes. Range is 5-65535.

Note

  • Tested against NXOSv 7.3.(0)D1(1) on VIRL
  • Unsupported for Cisco MDS
  • state has effect only in combination with system_mode_maintenance_timeout or system_mode_maintenance_on_reload_reset_reason.
  • Using system_mode_maintenance and system_mode_maintenance_dont_generate_profile would make the module fail, but the system mode will be triggered anyway.
  • For information on using CLI and NX-API see the :ref:`NXOS Platform Options guide <nxos_platform_options>`
  • For more information on using Ansible to manage network devices see the :ref:`Ansible Network Guide <network_guide>`
  • For more information on using Ansible to manage Cisco devices see the Cisco integration page.
# Trigger system maintenance mode
- cisco.nxos.nxos_gir:
    system_mode_maintenance: true
    host: '{{ inventory_hostname }}'
    username: '{{ un }}'
    password: '{{ pwd }}'
# Trigger system normal mode
- cisco.nxos.nxos_gir:
    system_mode_maintenance: false
    host: '{{ inventory_hostname }}'
    username: '{{ un }}'
    password: '{{ pwd }}'
# 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 }}'
# 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 }}'
# 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 }}'
# Set timeout for maintenance mode
- cisco.nxos.nxos_gir:
    system_mode_maintenance_timeout: 30
    state: present
    host: '{{ inventory_hostname }}'
    username: '{{ un }}'
    password: '{{ pwd }}'
# Remove timeout for maintenance mode
- cisco.nxos.nxos_gir:
    system_mode_maintenance_timeout: 30
    state: absent
    host: '{{ inventory_hostname }}'
    username: '{{ un }}'
    password: '{{ pwd }}'

Common return values are documented here, the following are the fields unique to this module:

Key Returned Description
changed
boolean
always
check to see if a change was made on the device

Sample:
True
final_system_mode
string
verbose mode
describe the last system mode

Sample:
normal
updates
list
verbose mode
commands sent to the device

Sample:
['terminal dont-ask', 'system mode maintenance timeout 10']


Authors

  • Gabriele Gerbino (@GGabriele)