| 1 |
.. _cisco.nxos.nxos_gir_module: |
| 2 |
|
| 3 |
|
| 4 |
******************* |
| 5 |
cisco.nxos.nxos_gir |
| 6 |
******************* |
| 7 |
|
| 8 |
**Trigger a graceful removal or insertion (GIR) of the switch.** |
| 9 |
|
| 10 |
|
| 11 |
Version added: 1.0.0 |
| 12 |
|
| 13 |
.. contents:: |
| 14 |
:local: |
| 15 |
:depth: 1 |
| 16 |
|
| 17 |
|
| 18 |
Synopsis |
| 19 |
-------- |
| 20 |
- Trigger a graceful removal or insertion (GIR) of the switch. |
| 21 |
- GIR processing may take more than 2 minutes. Timeout settings are automatically extended to 200s when user timeout settings are insufficient. |
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
Parameters |
| 27 |
---------- |
| 28 |
|
| 29 |
.. raw:: html |
| 30 |
|
| 31 |
<table border=0 cellpadding=0 class="documentation-table"> |
| 32 |
<tr> |
| 33 |
<th colspan="1">Parameter</th> |
| 34 |
<th>Choices/<font color="blue">Defaults</font></th> |
| 35 |
<th width="100%">Comments</th> |
| 36 |
</tr> |
| 37 |
<tr> |
| 38 |
<td colspan="1"> |
| 39 |
<div class="ansibleOptionAnchor" id="parameter-"></div> |
| 40 |
<b>state</b> |
| 41 |
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> |
| 42 |
<div style="font-size: small"> |
| 43 |
<span style="color: purple">string</span> |
| 44 |
</div> |
| 45 |
</td> |
| 46 |
<td> |
| 47 |
<ul style="margin: 0; padding: 0"><b>Choices:</b> |
| 48 |
<li><div style="color: blue"><b>present</b> ←</div></li> |
| 49 |
<li>absent</li> |
| 50 |
</ul> |
| 51 |
</td> |
| 52 |
<td> |
| 53 |
<div>Specify desired state of the resource.</div> |
| 54 |
</td> |
| 55 |
</tr> |
| 56 |
<tr> |
| 57 |
<td colspan="1"> |
| 58 |
<div class="ansibleOptionAnchor" id="parameter-"></div> |
| 59 |
<b>system_mode_maintenance</b> |
| 60 |
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> |
| 61 |
<div style="font-size: small"> |
| 62 |
<span style="color: purple">boolean</span> |
| 63 |
</div> |
| 64 |
</td> |
| 65 |
<td> |
| 66 |
<ul style="margin: 0; padding: 0"><b>Choices:</b> |
| 67 |
<li>no</li> |
| 68 |
<li>yes</li> |
| 69 |
</ul> |
| 70 |
</td> |
| 71 |
<td> |
| 72 |
<div>When <code>system_mode_maintenance=true</code> it puts all enabled protocols in maintenance mode (using the isolate command). When <code>system_mode_maintenance=false</code> it puts all enabled protocols in normal mode (using the no isolate command).</div> |
| 73 |
</td> |
| 74 |
</tr> |
| 75 |
<tr> |
| 76 |
<td colspan="1"> |
| 77 |
<div class="ansibleOptionAnchor" id="parameter-"></div> |
| 78 |
<b>system_mode_maintenance_dont_generate_profile</b> |
| 79 |
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> |
| 80 |
<div style="font-size: small"> |
| 81 |
<span style="color: purple">boolean</span> |
| 82 |
</div> |
| 83 |
</td> |
| 84 |
<td> |
| 85 |
<ul style="margin: 0; padding: 0"><b>Choices:</b> |
| 86 |
<li>no</li> |
| 87 |
<li>yes</li> |
| 88 |
</ul> |
| 89 |
</td> |
| 90 |
<td> |
| 91 |
<div>When <code>system_mode_maintenance_dont_generate_profile=true</code> 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 <code>system_mode_maintenance_dont_generate_profile=false</code> 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.</div> |
| 92 |
</td> |
| 93 |
</tr> |
| 94 |
<tr> |
| 95 |
<td colspan="1"> |
| 96 |
<div class="ansibleOptionAnchor" id="parameter-"></div> |
| 97 |
<b>system_mode_maintenance_on_reload_reset_reason</b> |
| 98 |
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> |
| 99 |
<div style="font-size: small"> |
| 100 |
<span style="color: purple">string</span> |
| 101 |
</div> |
| 102 |
</td> |
| 103 |
<td> |
| 104 |
<ul style="margin: 0; padding: 0"><b>Choices:</b> |
| 105 |
<li>hw_error</li> |
| 106 |
<li>svc_failure</li> |
| 107 |
<li>kern_failure</li> |
| 108 |
<li>wdog_timeout</li> |
| 109 |
<li>fatal_error</li> |
| 110 |
<li>lc_failure</li> |
| 111 |
<li>match_any</li> |
| 112 |
<li>manual_reload</li> |
| 113 |
<li>any_other</li> |
| 114 |
<li>maintenance</li> |
| 115 |
</ul> |
| 116 |
</td> |
| 117 |
<td> |
| 118 |
<div>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.</div> |
| 119 |
</td> |
| 120 |
</tr> |
| 121 |
<tr> |
| 122 |
<td colspan="1"> |
| 123 |
<div class="ansibleOptionAnchor" id="parameter-"></div> |
| 124 |
<b>system_mode_maintenance_shutdown</b> |
| 125 |
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> |
| 126 |
<div style="font-size: small"> |
| 127 |
<span style="color: purple">boolean</span> |
| 128 |
</div> |
| 129 |
</td> |
| 130 |
<td> |
| 131 |
<ul style="margin: 0; padding: 0"><b>Choices:</b> |
| 132 |
<li>no</li> |
| 133 |
<li>yes</li> |
| 134 |
</ul> |
| 135 |
</td> |
| 136 |
<td> |
| 137 |
<div>Shuts down all protocols, vPC domains, and interfaces except the management interface (using the shutdown command). This option is disruptive while <code>system_mode_maintenance</code> (which uses the isolate command) is not.</div> |
| 138 |
</td> |
| 139 |
</tr> |
| 140 |
<tr> |
| 141 |
<td colspan="1"> |
| 142 |
<div class="ansibleOptionAnchor" id="parameter-"></div> |
| 143 |
<b>system_mode_maintenance_timeout</b> |
| 144 |
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> |
| 145 |
<div style="font-size: small"> |
| 146 |
<span style="color: purple">string</span> |
| 147 |
</div> |
| 148 |
</td> |
| 149 |
<td> |
| 150 |
</td> |
| 151 |
<td> |
| 152 |
<div>Keeps the switch in maintenance mode for a specified number of minutes. Range is 5-65535.</div> |
| 153 |
</td> |
| 154 |
</tr> |
| 155 |
</table> |
| 156 |
<br/> |
| 157 |
|
| 158 |
|
| 159 |
Notes |
| 160 |
----- |
| 161 |
|
| 162 |
.. note:: |
| 163 |
- Tested against NXOSv 7.3.(0)D1(1) on VIRL |
| 164 |
- Unsupported for Cisco MDS |
| 165 |
- ``state`` has effect only in combination with ``system_mode_maintenance_timeout`` or ``system_mode_maintenance_on_reload_reset_reason``. |
| 166 |
- Using ``system_mode_maintenance`` and ``system_mode_maintenance_dont_generate_profile`` would make the module fail, but the system mode will be triggered anyway. |
| 167 |
- For information on using CLI and NX-API see the :ref:`NXOS Platform Options guide <nxos_platform_options>` |
| 168 |
- For more information on using Ansible to manage network devices see the :ref:`Ansible Network Guide <network_guide>` |
| 169 |
- For more information on using Ansible to manage Cisco devices see the `Cisco integration page <https://www.ansible.com/integrations/networks/cisco>`_. |
| 170 |
|
| 171 |
|
| 172 |
|
| 173 |
Examples |
| 174 |
-------- |
| 175 |
|
| 176 |
.. code-block:: yaml |
| 177 |
|
| 178 |
# Trigger system maintenance mode |
| 179 |
- cisco.nxos.nxos_gir: |
| 180 |
system_mode_maintenance: true |
| 181 |
host: '{{ inventory_hostname }}' |
| 182 |
username: '{{ un }}' |
| 183 |
password: '{{ pwd }}' |
| 184 |
# Trigger system normal mode |
| 185 |
- cisco.nxos.nxos_gir: |
| 186 |
system_mode_maintenance: false |
| 187 |
host: '{{ inventory_hostname }}' |
| 188 |
username: '{{ un }}' |
| 189 |
password: '{{ pwd }}' |
| 190 |
# Configure on-reload reset-reason for maintenance mode |
| 191 |
- cisco.nxos.nxos_gir: |
| 192 |
system_mode_maintenance_on_reload_reset_reason: manual_reload |
| 193 |
state: present |
| 194 |
host: '{{ inventory_hostname }}' |
| 195 |
username: '{{ un }}' |
| 196 |
password: '{{ pwd }}' |
| 197 |
# Add on-reload reset-reason for maintenance mode |
| 198 |
- cisco.nxos.nxos_gir: |
| 199 |
system_mode_maintenance_on_reload_reset_reason: hw_error |
| 200 |
state: present |
| 201 |
host: '{{ inventory_hostname }}' |
| 202 |
username: '{{ un }}' |
| 203 |
password: '{{ pwd }}' |
| 204 |
# Remove on-reload reset-reason for maintenance mode |
| 205 |
- cisco.nxos.nxos_gir: |
| 206 |
system_mode_maintenance_on_reload_reset_reason: manual_reload |
| 207 |
state: absent |
| 208 |
host: '{{ inventory_hostname }}' |
| 209 |
username: '{{ un }}' |
| 210 |
password: '{{ pwd }}' |
| 211 |
# Set timeout for maintenance mode |
| 212 |
- cisco.nxos.nxos_gir: |
| 213 |
system_mode_maintenance_timeout: 30 |
| 214 |
state: present |
| 215 |
host: '{{ inventory_hostname }}' |
| 216 |
username: '{{ un }}' |
| 217 |
password: '{{ pwd }}' |
| 218 |
# Remove timeout for maintenance mode |
| 219 |
- cisco.nxos.nxos_gir: |
| 220 |
system_mode_maintenance_timeout: 30 |
| 221 |
state: absent |
| 222 |
host: '{{ inventory_hostname }}' |
| 223 |
username: '{{ un }}' |
| 224 |
password: '{{ pwd }}' |
| 225 |
|
| 226 |
|
| 227 |
|
| 228 |
Return Values |
| 229 |
------------- |
| 230 |
Common return values are documented `here <https://docs.ansible.com/ansible/latest/reference_appendices/common_return_values.html#common-return-values>`_, the following are the fields unique to this module: |
| 231 |
|
| 232 |
.. raw:: html |
| 233 |
|
| 234 |
<table border=0 cellpadding=0 class="documentation-table"> |
| 235 |
<tr> |
| 236 |
<th colspan="1">Key</th> |
| 237 |
<th>Returned</th> |
| 238 |
<th width="100%">Description</th> |
| 239 |
</tr> |
| 240 |
<tr> |
| 241 |
<td colspan="1"> |
| 242 |
<div class="ansibleOptionAnchor" id="return-"></div> |
| 243 |
<b>changed</b> |
| 244 |
<a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a> |
| 245 |
<div style="font-size: small"> |
| 246 |
<span style="color: purple">boolean</span> |
| 247 |
</div> |
| 248 |
</td> |
| 249 |
<td>always</td> |
| 250 |
<td> |
| 251 |
<div>check to see if a change was made on the device</div> |
| 252 |
<br/> |
| 253 |
<div style="font-size: smaller"><b>Sample:</b></div> |
| 254 |
<div style="font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;">True</div> |
| 255 |
</td> |
| 256 |
</tr> |
| 257 |
<tr> |
| 258 |
<td colspan="1"> |
| 259 |
<div class="ansibleOptionAnchor" id="return-"></div> |
| 260 |
<b>final_system_mode</b> |
| 261 |
<a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a> |
| 262 |
<div style="font-size: small"> |
| 263 |
<span style="color: purple">string</span> |
| 264 |
</div> |
| 265 |
</td> |
| 266 |
<td>verbose mode</td> |
| 267 |
<td> |
| 268 |
<div>describe the last system mode</div> |
| 269 |
<br/> |
| 270 |
<div style="font-size: smaller"><b>Sample:</b></div> |
| 271 |
<div style="font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;">normal</div> |
| 272 |
</td> |
| 273 |
</tr> |
| 274 |
<tr> |
| 275 |
<td colspan="1"> |
| 276 |
<div class="ansibleOptionAnchor" id="return-"></div> |
| 277 |
<b>updates</b> |
| 278 |
<a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a> |
| 279 |
<div style="font-size: small"> |
| 280 |
<span style="color: purple">list</span> |
| 281 |
</div> |
| 282 |
</td> |
| 283 |
<td>verbose mode</td> |
| 284 |
<td> |
| 285 |
<div>commands sent to the device</div> |
| 286 |
<br/> |
| 287 |
<div style="font-size: smaller"><b>Sample:</b></div> |
| 288 |
<div style="font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;">['terminal dont-ask', 'system mode maintenance timeout 10']</div> |
| 289 |
</td> |
| 290 |
</tr> |
| 291 |
</table> |
| 292 |
<br/><br/> |
| 293 |
|
| 294 |
|
| 295 |
Status |
| 296 |
------ |
| 297 |
|
| 298 |
|
| 299 |
Authors |
| 300 |
~~~~~~~ |
| 301 |
|
| 302 |
- Gabriele Gerbino (@GGabriele) |