| 1 |
.. _cisco.nxos.nxos_hsrp_module: |
| 2 |
|
| 3 |
|
| 4 |
******************** |
| 5 |
cisco.nxos.nxos_hsrp |
| 6 |
******************** |
| 7 |
|
| 8 |
**(deprecated, removed after 2028-06-01) Manages HSRP configuration on NX-OS switches.** |
| 9 |
|
| 10 |
|
| 11 |
Version added: 1.0.0 |
| 12 |
|
| 13 |
.. contents:: |
| 14 |
:local: |
| 15 |
:depth: 1 |
| 16 |
|
| 17 |
|
| 18 |
Synopsis |
| 19 |
-------- |
| 20 |
- Manages HSRP configuration on NX-OS switches. |
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
Parameters |
| 26 |
---------- |
| 27 |
|
| 28 |
.. raw:: html |
| 29 |
|
| 30 |
<table border=0 cellpadding=0 class="documentation-table"> |
| 31 |
<tr> |
| 32 |
<th colspan="1">Parameter</th> |
| 33 |
<th>Choices/<font color="blue">Defaults</font></th> |
| 34 |
<th width="100%">Comments</th> |
| 35 |
</tr> |
| 36 |
<tr> |
| 37 |
<td colspan="1"> |
| 38 |
<div class="ansibleOptionAnchor" id="parameter-"></div> |
| 39 |
<b>auth_string</b> |
| 40 |
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> |
| 41 |
<div style="font-size: small"> |
| 42 |
<span style="color: purple">string</span> |
| 43 |
</div> |
| 44 |
</td> |
| 45 |
<td> |
| 46 |
</td> |
| 47 |
<td> |
| 48 |
<div>Authentication string. If this needs to be hidden(for md5 type), the string should be 7 followed by the key string. Otherwise, it can be 0 followed by key string or just key string (for backward compatibility). For text type, this should be just be a key string. if this is 'default', authentication is removed.</div> |
| 49 |
</td> |
| 50 |
</tr> |
| 51 |
<tr> |
| 52 |
<td colspan="1"> |
| 53 |
<div class="ansibleOptionAnchor" id="parameter-"></div> |
| 54 |
<b>auth_type</b> |
| 55 |
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> |
| 56 |
<div style="font-size: small"> |
| 57 |
<span style="color: purple">string</span> |
| 58 |
</div> |
| 59 |
</td> |
| 60 |
<td> |
| 61 |
<ul style="margin: 0; padding: 0"><b>Choices:</b> |
| 62 |
<li>text</li> |
| 63 |
<li>md5</li> |
| 64 |
</ul> |
| 65 |
</td> |
| 66 |
<td> |
| 67 |
<div>Authentication type.</div> |
| 68 |
</td> |
| 69 |
</tr> |
| 70 |
<tr> |
| 71 |
<td colspan="1"> |
| 72 |
<div class="ansibleOptionAnchor" id="parameter-"></div> |
| 73 |
<b>group</b> |
| 74 |
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> |
| 75 |
<div style="font-size: small"> |
| 76 |
<span style="color: purple">string</span> |
| 77 |
/ <span style="color: red">required</span> |
| 78 |
</div> |
| 79 |
</td> |
| 80 |
<td> |
| 81 |
</td> |
| 82 |
<td> |
| 83 |
<div>HSRP group number.</div> |
| 84 |
</td> |
| 85 |
</tr> |
| 86 |
<tr> |
| 87 |
<td colspan="1"> |
| 88 |
<div class="ansibleOptionAnchor" id="parameter-"></div> |
| 89 |
<b>interface</b> |
| 90 |
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> |
| 91 |
<div style="font-size: small"> |
| 92 |
<span style="color: purple">string</span> |
| 93 |
/ <span style="color: red">required</span> |
| 94 |
</div> |
| 95 |
</td> |
| 96 |
<td> |
| 97 |
</td> |
| 98 |
<td> |
| 99 |
<div>Full name of interface that is being managed for HSRP.</div> |
| 100 |
</td> |
| 101 |
</tr> |
| 102 |
<tr> |
| 103 |
<td colspan="1"> |
| 104 |
<div class="ansibleOptionAnchor" id="parameter-"></div> |
| 105 |
<b>preempt</b> |
| 106 |
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> |
| 107 |
<div style="font-size: small"> |
| 108 |
<span style="color: purple">string</span> |
| 109 |
</div> |
| 110 |
</td> |
| 111 |
<td> |
| 112 |
<ul style="margin: 0; padding: 0"><b>Choices:</b> |
| 113 |
<li>enabled</li> |
| 114 |
<li>disabled</li> |
| 115 |
</ul> |
| 116 |
</td> |
| 117 |
<td> |
| 118 |
<div>Enable/Disable preempt.</div> |
| 119 |
</td> |
| 120 |
</tr> |
| 121 |
<tr> |
| 122 |
<td colspan="1"> |
| 123 |
<div class="ansibleOptionAnchor" id="parameter-"></div> |
| 124 |
<b>priority</b> |
| 125 |
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> |
| 126 |
<div style="font-size: small"> |
| 127 |
<span style="color: purple">string</span> |
| 128 |
</div> |
| 129 |
</td> |
| 130 |
<td> |
| 131 |
</td> |
| 132 |
<td> |
| 133 |
<div>HSRP priority or keyword 'default'.</div> |
| 134 |
</td> |
| 135 |
</tr> |
| 136 |
<tr> |
| 137 |
<td colspan="1"> |
| 138 |
<div class="ansibleOptionAnchor" id="parameter-"></div> |
| 139 |
<b>state</b> |
| 140 |
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> |
| 141 |
<div style="font-size: small"> |
| 142 |
<span style="color: purple">string</span> |
| 143 |
</div> |
| 144 |
</td> |
| 145 |
<td> |
| 146 |
<ul style="margin: 0; padding: 0"><b>Choices:</b> |
| 147 |
<li><div style="color: blue"><b>present</b> ←</div></li> |
| 148 |
<li>absent</li> |
| 149 |
</ul> |
| 150 |
</td> |
| 151 |
<td> |
| 152 |
<div>Specify desired state of the resource.</div> |
| 153 |
</td> |
| 154 |
</tr> |
| 155 |
<tr> |
| 156 |
<td colspan="1"> |
| 157 |
<div class="ansibleOptionAnchor" id="parameter-"></div> |
| 158 |
<b>version</b> |
| 159 |
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> |
| 160 |
<div style="font-size: small"> |
| 161 |
<span style="color: purple">string</span> |
| 162 |
</div> |
| 163 |
</td> |
| 164 |
<td> |
| 165 |
<ul style="margin: 0; padding: 0"><b>Choices:</b> |
| 166 |
<li><div style="color: blue"><b>1</b> ←</div></li> |
| 167 |
<li>2</li> |
| 168 |
</ul> |
| 169 |
</td> |
| 170 |
<td> |
| 171 |
<div>HSRP version.</div> |
| 172 |
</td> |
| 173 |
</tr> |
| 174 |
<tr> |
| 175 |
<td colspan="1"> |
| 176 |
<div class="ansibleOptionAnchor" id="parameter-"></div> |
| 177 |
<b>vip</b> |
| 178 |
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> |
| 179 |
<div style="font-size: small"> |
| 180 |
<span style="color: purple">string</span> |
| 181 |
</div> |
| 182 |
</td> |
| 183 |
<td> |
| 184 |
</td> |
| 185 |
<td> |
| 186 |
<div>HSRP virtual IP address or keyword 'default'</div> |
| 187 |
</td> |
| 188 |
</tr> |
| 189 |
</table> |
| 190 |
<br/> |
| 191 |
|
| 192 |
|
| 193 |
Notes |
| 194 |
----- |
| 195 |
|
| 196 |
.. note:: |
| 197 |
- Tested against NXOSv 7.3.(0)D1(1) on VIRL |
| 198 |
- Unsupported for Cisco MDS |
| 199 |
- HSRP feature needs to be enabled first on the system. |
| 200 |
- SVIs must exist before using this module. |
| 201 |
- Interface must be a L3 port before using this module. |
| 202 |
- HSRP cannot be configured on loopback interfaces. |
| 203 |
- MD5 authentication is only possible with HSRPv2 while it is ignored if HSRPv1 is used instead, while it will not raise any error. Here we allow MD5 authentication only with HSRPv2 in order to enforce better practice. |
| 204 |
- For information on using CLI and NX-API see the :ref:`NXOS Platform Options guide <nxos_platform_options>` |
| 205 |
- For more information on using Ansible to manage network devices see the :ref:`Ansible Network Guide <network_guide>` |
| 206 |
- For more information on using Ansible to manage Cisco devices see the `Cisco integration page <https://www.ansible.com/integrations/networks/cisco>`_. |
| 207 |
|
| 208 |
|
| 209 |
|
| 210 |
Examples |
| 211 |
-------- |
| 212 |
|
| 213 |
.. code-block:: yaml |
| 214 |
|
| 215 |
- name: Ensure HSRP is configured with following params on a SVI |
| 216 |
cisco.nxos.nxos_hsrp: |
| 217 |
group: 10 |
| 218 |
vip: 10.1.1.1 |
| 219 |
priority: 150 |
| 220 |
interface: vlan10 |
| 221 |
preempt: enabled |
| 222 |
|
| 223 |
- name: Ensure HSRP is configured with following params on a SVI with clear text authentication |
| 224 |
cisco.nxos.nxos_hsrp: |
| 225 |
group: 10 |
| 226 |
vip: 10.1.1.1 |
| 227 |
priority: 150 |
| 228 |
interface: vlan10 |
| 229 |
preempt: enabled |
| 230 |
auth_type: text |
| 231 |
auth_string: CISCO |
| 232 |
|
| 233 |
- name: Ensure HSRP is configured with md5 authentication and clear authentication |
| 234 |
string |
| 235 |
cisco.nxos.nxos_hsrp: |
| 236 |
group: 10 |
| 237 |
vip: 10.1.1.1 |
| 238 |
priority: 150 |
| 239 |
interface: vlan10 |
| 240 |
preempt: enabled |
| 241 |
auth_type: md5 |
| 242 |
auth_string: 0 1234 |
| 243 |
|
| 244 |
- name: Ensure HSRP is configured with md5 authentication and hidden authentication |
| 245 |
string |
| 246 |
cisco.nxos.nxos_hsrp: |
| 247 |
group: 10 |
| 248 |
vip: 10.1.1.1 |
| 249 |
priority: 150 |
| 250 |
interface: vlan10 |
| 251 |
preempt: enabled |
| 252 |
auth_type: md5 |
| 253 |
auth_string: 7 1234 |
| 254 |
|
| 255 |
- name: Remove HSRP config for given interface, group, and VIP |
| 256 |
cisco.nxos.nxos_hsrp: |
| 257 |
group: 10 |
| 258 |
interface: vlan10 |
| 259 |
vip: 10.1.1.1 |
| 260 |
state: absent |
| 261 |
|
| 262 |
|
| 263 |
|
| 264 |
Return Values |
| 265 |
------------- |
| 266 |
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: |
| 267 |
|
| 268 |
.. raw:: html |
| 269 |
|
| 270 |
<table border=0 cellpadding=0 class="documentation-table"> |
| 271 |
<tr> |
| 272 |
<th colspan="1">Key</th> |
| 273 |
<th>Returned</th> |
| 274 |
<th width="100%">Description</th> |
| 275 |
</tr> |
| 276 |
<tr> |
| 277 |
<td colspan="1"> |
| 278 |
<div class="ansibleOptionAnchor" id="return-"></div> |
| 279 |
<b>commands</b> |
| 280 |
<a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a> |
| 281 |
<div style="font-size: small"> |
| 282 |
<span style="color: purple">list</span> |
| 283 |
</div> |
| 284 |
</td> |
| 285 |
<td>always</td> |
| 286 |
<td> |
| 287 |
<div>commands sent to the device</div> |
| 288 |
<br/> |
| 289 |
<div style="font-size: smaller"><b>Sample:</b></div> |
| 290 |
<div style="font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;">['interface vlan10', 'hsrp version 2', 'hsrp 30', 'ip 10.30.1.1']</div> |
| 291 |
</td> |
| 292 |
</tr> |
| 293 |
</table> |
| 294 |
<br/><br/> |
| 295 |
|
| 296 |
|
| 297 |
Status |
| 298 |
------ |
| 299 |
|
| 300 |
|
| 301 |
Authors |
| 302 |
~~~~~~~ |
| 303 |
|
| 304 |
- Jason Edelman (@jedelman8) |
| 305 |
- Gabriele Gerbino (@GGabriele) |