cisco.nxos.nxos_gir module – Trigger a graceful removal or insertion (GIR) of the switch.
Note
This module is part of the cisco.nxos collection (version 5.3.0).
You might already have this collection installed if you are using the ansible
package.
It is not included in ansible-core
.
To check whether it is installed, run ansible-galaxy collection list
.
To install it, use: ansible-galaxy collection install cisco.nxos
.
To use it in a playbook, specify: cisco.nxos.nxos_gir
.
New in cisco.nxos 1.0.0
Synopsis
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.
Note
This module has a corresponding action plugin.
Aliases: gir
Parameters
Parameter |
Comments |
---|---|
Specify desired state of the resource. Choices:
|
|
When Choices:
|
|
When Choices:
|
|
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. Choices:
|
|
Shuts down all protocols, vPC domains, and interfaces except the management interface (using the shutdown command). This option is disruptive while Choices:
|
|
Keeps the switch in maintenance mode for a specified number of minutes. Range is 5-65535. |
Notes
Note
Tested against NXOSv 7.3.(0)D1(1) on VIRL
Unsupported for Cisco MDS
state
has effect only in combination withsystem_mode_maintenance_timeout
orsystem_mode_maintenance_on_reload_reset_reason
.Using
system_mode_maintenance
andsystem_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 <https://www.ansible.com/integrations/networks/cisco>`_.
Examples
# 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 }}'
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
check to see if a change was made on the device Returned: always Sample: |
|
describe the last system mode Returned: verbose mode Sample: |
|
commands sent to the device Returned: verbose mode Sample: |