| 1 |
.. _cisco.ios.ios_lag_interfaces_module: |
| 2 |
|
| 3 |
|
| 4 |
**************************** |
| 5 |
cisco.ios.ios_lag_interfaces |
| 6 |
**************************** |
| 7 |
|
| 8 |
**Resource module to configure LAG interfaces.** |
| 9 |
|
| 10 |
|
| 11 |
Version added: 1.0.0 |
| 12 |
|
| 13 |
.. contents:: |
| 14 |
:local: |
| 15 |
:depth: 1 |
| 16 |
|
| 17 |
|
| 18 |
Synopsis |
| 19 |
-------- |
| 20 |
- This module manages properties of Link Aggregation Group on Cisco IOS devices. |
| 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="3">Parameter</th> |
| 33 |
<th>Choices/<font color="blue">Defaults</font></th> |
| 34 |
<th width="100%">Comments</th> |
| 35 |
</tr> |
| 36 |
<tr> |
| 37 |
<td colspan="3"> |
| 38 |
<div class="ansibleOptionAnchor" id="parameter-"></div> |
| 39 |
<b>config</b> |
| 40 |
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> |
| 41 |
<div style="font-size: small"> |
| 42 |
<span style="color: purple">list</span> |
| 43 |
/ <span style="color: purple">elements=dictionary</span> |
| 44 |
</div> |
| 45 |
</td> |
| 46 |
<td> |
| 47 |
</td> |
| 48 |
<td> |
| 49 |
<div>A list of link aggregation group configurations.</div> |
| 50 |
</td> |
| 51 |
</tr> |
| 52 |
<tr> |
| 53 |
<td class="elbow-placeholder"></td> |
| 54 |
<td colspan="2"> |
| 55 |
<div class="ansibleOptionAnchor" id="parameter-"></div> |
| 56 |
<b>members</b> |
| 57 |
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> |
| 58 |
<div style="font-size: small"> |
| 59 |
<span style="color: purple">list</span> |
| 60 |
/ <span style="color: purple">elements=dictionary</span> |
| 61 |
</div> |
| 62 |
</td> |
| 63 |
<td> |
| 64 |
</td> |
| 65 |
<td> |
| 66 |
<div>Interface options for the link aggregation group.</div> |
| 67 |
</td> |
| 68 |
</tr> |
| 69 |
<tr> |
| 70 |
<td class="elbow-placeholder"></td> |
| 71 |
<td class="elbow-placeholder"></td> |
| 72 |
<td colspan="1"> |
| 73 |
<div class="ansibleOptionAnchor" id="parameter-"></div> |
| 74 |
<b>link</b> |
| 75 |
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> |
| 76 |
<div style="font-size: small"> |
| 77 |
<span style="color: purple">integer</span> |
| 78 |
</div> |
| 79 |
</td> |
| 80 |
<td> |
| 81 |
</td> |
| 82 |
<td> |
| 83 |
<div>Assign a link identifier used for load-balancing.</div> |
| 84 |
<div>Refer to vendor documentation for valid values.</div> |
| 85 |
<div>NOTE, parameter only supported on Cisco IOS XE platform.</div> |
| 86 |
</td> |
| 87 |
</tr> |
| 88 |
<tr> |
| 89 |
<td class="elbow-placeholder"></td> |
| 90 |
<td class="elbow-placeholder"></td> |
| 91 |
<td colspan="1"> |
| 92 |
<div class="ansibleOptionAnchor" id="parameter-"></div> |
| 93 |
<b>member</b> |
| 94 |
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> |
| 95 |
<div style="font-size: small"> |
| 96 |
<span style="color: purple">string</span> |
| 97 |
</div> |
| 98 |
</td> |
| 99 |
<td> |
| 100 |
</td> |
| 101 |
<td> |
| 102 |
<div>Interface member of the link aggregation group.</div> |
| 103 |
</td> |
| 104 |
</tr> |
| 105 |
<tr> |
| 106 |
<td class="elbow-placeholder"></td> |
| 107 |
<td class="elbow-placeholder"></td> |
| 108 |
<td colspan="1"> |
| 109 |
<div class="ansibleOptionAnchor" id="parameter-"></div> |
| 110 |
<b>mode</b> |
| 111 |
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> |
| 112 |
<div style="font-size: small"> |
| 113 |
<span style="color: purple">string</span> |
| 114 |
</div> |
| 115 |
</td> |
| 116 |
<td> |
| 117 |
<ul style="margin: 0; padding: 0"><b>Choices:</b> |
| 118 |
<li>auto</li> |
| 119 |
<li>on</li> |
| 120 |
<li>desirable</li> |
| 121 |
<li>active</li> |
| 122 |
<li>passive</li> |
| 123 |
</ul> |
| 124 |
</td> |
| 125 |
<td> |
| 126 |
<div>Etherchannel Mode of the interface for link aggregation.</div> |
| 127 |
<div>On mode has to be quoted as 'on' or else pyyaml will convert to True before it gets to Ansible.</div> |
| 128 |
</td> |
| 129 |
</tr> |
| 130 |
|
| 131 |
<tr> |
| 132 |
<td class="elbow-placeholder"></td> |
| 133 |
<td colspan="2"> |
| 134 |
<div class="ansibleOptionAnchor" id="parameter-"></div> |
| 135 |
<b>name</b> |
| 136 |
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> |
| 137 |
<div style="font-size: small"> |
| 138 |
<span style="color: purple">string</span> |
| 139 |
/ <span style="color: red">required</span> |
| 140 |
</div> |
| 141 |
</td> |
| 142 |
<td> |
| 143 |
</td> |
| 144 |
<td> |
| 145 |
<div>ID of Ethernet Channel of interfaces.</div> |
| 146 |
<div>Refer to vendor documentation for valid port values.</div> |
| 147 |
</td> |
| 148 |
</tr> |
| 149 |
|
| 150 |
<tr> |
| 151 |
<td colspan="3"> |
| 152 |
<div class="ansibleOptionAnchor" id="parameter-"></div> |
| 153 |
<b>running_config</b> |
| 154 |
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> |
| 155 |
<div style="font-size: small"> |
| 156 |
<span style="color: purple">string</span> |
| 157 |
</div> |
| 158 |
</td> |
| 159 |
<td> |
| 160 |
</td> |
| 161 |
<td> |
| 162 |
<div>This option is used only with state <em>parsed</em>.</div> |
| 163 |
<div>The value of this option should be the output received from the IOS device by executing the command <b>show running-config | section ^interface</b>.</div> |
| 164 |
<div>The state <em>parsed</em> reads the configuration from <code>running_config</code> option and transforms it into Ansible structured data as per the resource module's argspec and the value is then returned in the <em>parsed</em> key within the result.</div> |
| 165 |
</td> |
| 166 |
</tr> |
| 167 |
<tr> |
| 168 |
<td colspan="3"> |
| 169 |
<div class="ansibleOptionAnchor" id="parameter-"></div> |
| 170 |
<b>state</b> |
| 171 |
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> |
| 172 |
<div style="font-size: small"> |
| 173 |
<span style="color: purple">string</span> |
| 174 |
</div> |
| 175 |
</td> |
| 176 |
<td> |
| 177 |
<ul style="margin: 0; padding: 0"><b>Choices:</b> |
| 178 |
<li><div style="color: blue"><b>merged</b> ←</div></li> |
| 179 |
<li>replaced</li> |
| 180 |
<li>overridden</li> |
| 181 |
<li>deleted</li> |
| 182 |
<li>rendered</li> |
| 183 |
<li>parsed</li> |
| 184 |
<li>gathered</li> |
| 185 |
</ul> |
| 186 |
</td> |
| 187 |
<td> |
| 188 |
<div>The state the configuration should be left in</div> |
| 189 |
<div>The states <em>rendered</em>, <em>gathered</em> and <em>parsed</em> does not perform any change on the device.</div> |
| 190 |
<div>The state <em>rendered</em> will transform the configuration in <code>config</code> option to platform specific CLI commands which will be returned in the <em>rendered</em> key within the result. For state <em>rendered</em> active connection to remote host is not required.</div> |
| 191 |
<div>The state <em>gathered</em> will fetch the running configuration from device and transform it into structured data in the format as per the resource module argspec and the value is returned in the <em>gathered</em> key within the result.</div> |
| 192 |
<div>The state <em>parsed</em> reads the configuration from <code>running_config</code> option and transforms it into JSON format as per the resource module parameters and the value is returned in the <em>parsed</em> key within the result. The value of <code>running_config</code> option should be the same format as the output of command <em>show running-config | include ip route|ipv6 route</em> executed on device. For state <em>parsed</em> active connection to remote host is not required.</div> |
| 193 |
</td> |
| 194 |
</tr> |
| 195 |
</table> |
| 196 |
<br/> |
| 197 |
|
| 198 |
|
| 199 |
Notes |
| 200 |
----- |
| 201 |
|
| 202 |
.. note:: |
| 203 |
- Tested against Cisco IOSXE Version 17.3 on CML. |
| 204 |
- This module works with connection ``network_cli``. See https://docs.ansible.com/ansible/latest/network/user_guide/platform_ios.html |
| 205 |
|
| 206 |
|
| 207 |
|
| 208 |
Examples |
| 209 |
-------- |
| 210 |
|
| 211 |
.. code-block:: yaml |
| 212 |
|
| 213 |
# Using merged |
| 214 |
# |
| 215 |
# Before state: |
| 216 |
# ------------- |
| 217 |
# |
| 218 |
# vios#show running-config | section ^interface |
| 219 |
# interface Port-channel10 |
| 220 |
# interface GigabitEthernet0/1 |
| 221 |
# shutdown |
| 222 |
# interface GigabitEthernet0/2 |
| 223 |
# shutdown |
| 224 |
# interface GigabitEthernet0/3 |
| 225 |
# shutdown |
| 226 |
# interface GigabitEthernet0/4 |
| 227 |
# shutdown |
| 228 |
|
| 229 |
- name: Merge provided configuration with device configuration |
| 230 |
cisco.ios.ios_lag_interfaces: |
| 231 |
config: |
| 232 |
- name: Port-channel10 |
| 233 |
members: |
| 234 |
- member: GigabitEthernet0/1 |
| 235 |
mode: auto |
| 236 |
- member: GigabitEthernet0/2 |
| 237 |
mode: auto |
| 238 |
- name: Port-channel20 |
| 239 |
members: |
| 240 |
- member: GigabitEthernet0/3 |
| 241 |
mode: "on" |
| 242 |
- name: Port-channel30 |
| 243 |
members: |
| 244 |
- member: GigabitEthernet0/4 |
| 245 |
mode: active |
| 246 |
state: merged |
| 247 |
|
| 248 |
# Task Output: |
| 249 |
# --------------- |
| 250 |
|
| 251 |
# commands: |
| 252 |
# - interface GigabitEthernet0/1 |
| 253 |
# - channel-group 10 mode auto |
| 254 |
# - interface GigabitEthernet0/2 |
| 255 |
# - channel-group 10 mode auto |
| 256 |
# - interface GigabitEthernet0/3 |
| 257 |
# - channel-group 20 mode on |
| 258 |
# - interface GigabitEthernet0/4 |
| 259 |
# - channel-group 30 mode active |
| 260 |
|
| 261 |
# After state: |
| 262 |
# ------------ |
| 263 |
# |
| 264 |
# vios#show running-config | section ^interface |
| 265 |
# interface Port-channel10 |
| 266 |
# interface Port-channel20 |
| 267 |
# interface Port-channel30 |
| 268 |
# interface GigabitEthernet0/1 |
| 269 |
# shutdown |
| 270 |
# channel-group 10 mode auto |
| 271 |
# interface GigabitEthernet0/2 |
| 272 |
# shutdown |
| 273 |
# channel-group 10 mode auto |
| 274 |
# interface GigabitEthernet0/3 |
| 275 |
# shutdown |
| 276 |
# channel-group 20 mode on |
| 277 |
# interface GigabitEthernet0/4 |
| 278 |
# shutdown |
| 279 |
# channel-group 30 mode active |
| 280 |
|
| 281 |
# Using overridden |
| 282 |
# |
| 283 |
# Before state: |
| 284 |
# ------------- |
| 285 |
# |
| 286 |
# vios#show running-config | section ^interface |
| 287 |
# interface Port-channel10 |
| 288 |
# interface Port-channel20 |
| 289 |
# interface Port-channel30 |
| 290 |
# interface GigabitEthernet0/1 |
| 291 |
# shutdown |
| 292 |
# channel-group 10 mode auto |
| 293 |
# interface GigabitEthernet0/2 |
| 294 |
# shutdown |
| 295 |
# channel-group 10 mode auto |
| 296 |
# interface GigabitEthernet0/3 |
| 297 |
# shutdown |
| 298 |
# channel-group 20 mode on |
| 299 |
# interface GigabitEthernet0/4 |
| 300 |
# shutdown |
| 301 |
# channel-group 30 mode active |
| 302 |
|
| 303 |
- name: Override device configuration of all interfaces with provided configuration |
| 304 |
cisco.ios.ios_lag_interfaces: |
| 305 |
config: |
| 306 |
- name: Port-channel20 |
| 307 |
members: |
| 308 |
- member: GigabitEthernet0/2 |
| 309 |
mode: auto |
| 310 |
- member: GigabitEthernet0/3 |
| 311 |
mode: auto |
| 312 |
state: overridden |
| 313 |
|
| 314 |
# Task Output: |
| 315 |
# --------------- |
| 316 |
|
| 317 |
# commands: |
| 318 |
# - interface GigabitEthernet0/1 |
| 319 |
# - no channel-group 10 mode auto |
| 320 |
# - interface GigabitEthernet0/2 |
| 321 |
# - no channel-group 10 mode auto |
| 322 |
# - interface GigabitEthernet0/4 |
| 323 |
# - no channel-group 30 mode active |
| 324 |
# - interface GigabitEthernet0/2 |
| 325 |
# - channel-group 20 mode auto |
| 326 |
# - interface GigabitEthernet0/3 |
| 327 |
# - channel-group 20 mode auto |
| 328 |
|
| 329 |
# After state: |
| 330 |
# ------------ |
| 331 |
# |
| 332 |
# vios#show running-config | section ^interface |
| 333 |
# interface Port-channel10 |
| 334 |
# interface Port-channel20 |
| 335 |
# interface Port-channel30 |
| 336 |
# interface GigabitEthernet0/1 |
| 337 |
# shutdown |
| 338 |
# interface GigabitEthernet0/2 |
| 339 |
# shutdown |
| 340 |
# channel-group 20 mode auto |
| 341 |
# interface GigabitEthernet0/3 |
| 342 |
# shutdown |
| 343 |
# channel-group 20 mode auto |
| 344 |
# interface GigabitEthernet0/4 |
| 345 |
# shutdown |
| 346 |
|
| 347 |
# Using replaced |
| 348 |
# |
| 349 |
# Before state: |
| 350 |
# ------------- |
| 351 |
# |
| 352 |
# vios#show running-config | section ^interface |
| 353 |
# interface Port-channel10 |
| 354 |
# interface Port-channel20 |
| 355 |
# interface Port-channel30 |
| 356 |
# interface GigabitEthernet0/1 |
| 357 |
# shutdown |
| 358 |
# channel-group 10 mode auto |
| 359 |
# interface GigabitEthernet0/2 |
| 360 |
# shutdown |
| 361 |
# channel-group 10 mode auto |
| 362 |
# interface GigabitEthernet0/3 |
| 363 |
# shutdown |
| 364 |
# channel-group 20 mode on |
| 365 |
# interface GigabitEthernet0/4 |
| 366 |
# shutdown |
| 367 |
# channel-group 30 mode active |
| 368 |
|
| 369 |
- name: Replaces device configuration of listed interfaces with provided configuration |
| 370 |
cisco.ios.ios_lag_interfaces: |
| 371 |
config: |
| 372 |
- name: Port-channel30 |
| 373 |
members: |
| 374 |
- member: GigabitEthernet0/3 |
| 375 |
mode: auto |
| 376 |
state: replaced |
| 377 |
|
| 378 |
# Task Output: |
| 379 |
# --------------- |
| 380 |
|
| 381 |
# commands: |
| 382 |
# - interface GigabitEthernet0/3 |
| 383 |
# - channel-group 30 mode auto |
| 384 |
# - interface GigabitEthernet0/4 |
| 385 |
# - no channel-group 30 mode active |
| 386 |
|
| 387 |
# After state: |
| 388 |
# ------------ |
| 389 |
# |
| 390 |
# vios#show running-config | section ^interface |
| 391 |
# interface Port-channel10 |
| 392 |
# interface Port-channel20 |
| 393 |
# interface Port-channel30 |
| 394 |
# interface GigabitEthernet0/1 |
| 395 |
# shutdown |
| 396 |
# channel-group 10 mode auto |
| 397 |
# interface GigabitEthernet0/2 |
| 398 |
# shutdown |
| 399 |
# channel-group 10 mode auto |
| 400 |
# interface GigabitEthernet0/3 |
| 401 |
# shutdown |
| 402 |
# channel-group 30 mode auto |
| 403 |
# interface GigabitEthernet0/4 |
| 404 |
# shutdown |
| 405 |
|
| 406 |
# Using Deleted |
| 407 |
# |
| 408 |
# Before state: |
| 409 |
# ------------- |
| 410 |
# |
| 411 |
# vios#show running-config | section ^interface |
| 412 |
# interface Port-channel10 |
| 413 |
# interface Port-channel20 |
| 414 |
# interface Port-channel30 |
| 415 |
# interface GigabitEthernet0/1 |
| 416 |
# shutdown |
| 417 |
# channel-group 10 mode auto |
| 418 |
# interface GigabitEthernet0/2 |
| 419 |
# shutdown |
| 420 |
# channel-group 10 mode auto |
| 421 |
# interface GigabitEthernet0/3 |
| 422 |
# shutdown |
| 423 |
# channel-group 20 mode on |
| 424 |
# interface GigabitEthernet0/4 |
| 425 |
# shutdown |
| 426 |
# channel-group 30 mode active |
| 427 |
|
| 428 |
- name: "Delete LAG attributes of given interfaces (Note: This won't delete the interface itself)" |
| 429 |
cisco.ios.ios_lag_interfaces: |
| 430 |
config: |
| 431 |
- name: Port-channel10 |
| 432 |
- name: Port-channel20 |
| 433 |
state: deleted |
| 434 |
|
| 435 |
# Task Output: |
| 436 |
# --------------- |
| 437 |
|
| 438 |
# commands: |
| 439 |
# - interface GigabitEthernet0/1 |
| 440 |
# - no channel-group 10 mode auto |
| 441 |
# - interface GigabitEthernet0/2 |
| 442 |
# - no channel-group 10 mode auto |
| 443 |
# - interface GigabitEthernet0/3 |
| 444 |
# - no channel-group 20 mode on |
| 445 |
|
| 446 |
# After state: |
| 447 |
# ------------- |
| 448 |
# |
| 449 |
# vios#show running-config | section ^interface |
| 450 |
# interface Port-channel10 |
| 451 |
# interface Port-channel20 |
| 452 |
# interface Port-channel30 |
| 453 |
# interface GigabitEthernet0/1 |
| 454 |
# shutdown |
| 455 |
# interface GigabitEthernet0/2 |
| 456 |
# shutdown |
| 457 |
# interface GigabitEthernet0/3 |
| 458 |
# shutdown |
| 459 |
# interface GigabitEthernet0/4 |
| 460 |
# shutdown |
| 461 |
# channel-group 30 mode active |
| 462 |
|
| 463 |
# Using Deleted without any config passed |
| 464 |
# "(NOTE: This will delete all of configured LLDP module attributes)" |
| 465 |
|
| 466 |
# |
| 467 |
# Before state: |
| 468 |
# ------------- |
| 469 |
# |
| 470 |
# vios#show running-config | section ^interface |
| 471 |
# interface Port-channel10 |
| 472 |
# interface Port-channel20 |
| 473 |
# interface Port-channel30 |
| 474 |
# interface GigabitEthernet0/1 |
| 475 |
# shutdown |
| 476 |
# channel-group 10 mode auto |
| 477 |
# interface GigabitEthernet0/2 |
| 478 |
# shutdown |
| 479 |
# channel-group 10 mode auto |
| 480 |
# interface GigabitEthernet0/3 |
| 481 |
# shutdown |
| 482 |
# channel-group 20 mode on |
| 483 |
# interface GigabitEthernet0/4 |
| 484 |
# shutdown |
| 485 |
# channel-group 30 mode active |
| 486 |
|
| 487 |
- name: "Delete all configured LAG attributes for interfaces (Note: This won't delete the interface itself)" |
| 488 |
cisco.ios.ios_lag_interfaces: |
| 489 |
state: deleted |
| 490 |
|
| 491 |
# Task Output: |
| 492 |
# --------------- |
| 493 |
|
| 494 |
# commands: |
| 495 |
# - interface GigabitEthernet0/1 |
| 496 |
# - no channel-group 10 mode auto |
| 497 |
# - interface GigabitEthernet0/2 |
| 498 |
# - no channel-group 10 mode auto |
| 499 |
# - interface GigabitEthernet0/3 |
| 500 |
# - no channel-group 20 mode on |
| 501 |
# - interface GigabitEthernet0/4 |
| 502 |
# - no channel-group 30 mode active |
| 503 |
|
| 504 |
# After state: |
| 505 |
# ------------- |
| 506 |
# |
| 507 |
# vios#show running-config | section ^interface |
| 508 |
# interface Port-channel10 |
| 509 |
# interface Port-channel20 |
| 510 |
# interface Port-channel30 |
| 511 |
# interface GigabitEthernet0/1 |
| 512 |
# shutdown |
| 513 |
# interface GigabitEthernet0/2 |
| 514 |
# shutdown |
| 515 |
# interface GigabitEthernet0/3 |
| 516 |
# shutdown |
| 517 |
# interface GigabitEthernet0/4 |
| 518 |
# shutdown |
| 519 |
|
| 520 |
# Using Gathered |
| 521 |
|
| 522 |
# Before state: |
| 523 |
# ------------- |
| 524 |
# |
| 525 |
# vios#show running-config | section ^interface |
| 526 |
# interface Port-channel10 |
| 527 |
# interface Port-channel20 |
| 528 |
# interface Port-channel30 |
| 529 |
# interface GigabitEthernet0/1 |
| 530 |
# shutdown |
| 531 |
# channel-group 10 mode auto |
| 532 |
# interface GigabitEthernet0/2 |
| 533 |
# shutdown |
| 534 |
# channel-group 10 mode auto |
| 535 |
# interface GigabitEthernet0/3 |
| 536 |
# shutdown |
| 537 |
# channel-group 20 mode on |
| 538 |
# interface GigabitEthernet0/4 |
| 539 |
# shutdown |
| 540 |
# channel-group 30 mode active |
| 541 |
|
| 542 |
- name: Gather listed LAG interfaces with provided configurations |
| 543 |
cisco.ios.ios_lag_interfaces: |
| 544 |
config: |
| 545 |
state: gathered |
| 546 |
|
| 547 |
# Module Execution Result: |
| 548 |
# ------------------------ |
| 549 |
# |
| 550 |
# "gathered": [ |
| 551 |
# { |
| 552 |
# "members": [ |
| 553 |
# { |
| 554 |
# "member": "GigabitEthernet0/1", |
| 555 |
# "mode": "auto" |
| 556 |
# }, |
| 557 |
# { |
| 558 |
# "member": "GigabitEthernet0/2", |
| 559 |
# "mode": "auto" |
| 560 |
# } |
| 561 |
# ], |
| 562 |
# "name": "Port-channel10" |
| 563 |
# }, |
| 564 |
# { |
| 565 |
# "members": [ |
| 566 |
# { |
| 567 |
# "member": "GigabitEthernet0/3", |
| 568 |
# "mode": "on" |
| 569 |
# } |
| 570 |
# ], |
| 571 |
# "name": "Port-channel20" |
| 572 |
# }, |
| 573 |
# { |
| 574 |
# "members": [ |
| 575 |
# { |
| 576 |
# "member": "GigabitEthernet0/4", |
| 577 |
# "mode": "active" |
| 578 |
# } |
| 579 |
# ], |
| 580 |
# "name": "Port-channel30" |
| 581 |
# } |
| 582 |
# ] |
| 583 |
|
| 584 |
# After state: |
| 585 |
# ------------ |
| 586 |
# |
| 587 |
# vios#sh running-config | section ^interface |
| 588 |
# interface Port-channel10 |
| 589 |
# interface Port-channel20 |
| 590 |
# interface Port-channel30 |
| 591 |
# interface GigabitEthernet0/1 |
| 592 |
# shutdown |
| 593 |
# channel-group 10 mode auto |
| 594 |
# interface GigabitEthernet0/2 |
| 595 |
# shutdown |
| 596 |
# channel-group 10 mode auto |
| 597 |
# interface GigabitEthernet0/3 |
| 598 |
# shutdown |
| 599 |
# channel-group 20 mode on |
| 600 |
# interface GigabitEthernet0/4 |
| 601 |
# shutdown |
| 602 |
# channel-group 30 mode active |
| 603 |
|
| 604 |
# Using Rendered |
| 605 |
|
| 606 |
- name: Render the commands for provided configuration |
| 607 |
cisco.ios.ios_lag_interfaces: |
| 608 |
config: |
| 609 |
- name: Port-channel11 |
| 610 |
members: |
| 611 |
- member: GigabitEthernet0/1 |
| 612 |
mode: active |
| 613 |
- name: Port-channel22 |
| 614 |
members: |
| 615 |
- member: GigabitEthernet0/2 |
| 616 |
mode: passive |
| 617 |
state: rendered |
| 618 |
|
| 619 |
# Module Execution Result: |
| 620 |
# ------------------------ |
| 621 |
# |
| 622 |
# "rendered": [ |
| 623 |
# "interface GigabitEthernet0/1", |
| 624 |
# "channel-group 11 mode active", |
| 625 |
# "interface GigabitEthernet0/2", |
| 626 |
# "channel-group 22 mode passive", |
| 627 |
# ] |
| 628 |
|
| 629 |
# Using Parsed |
| 630 |
|
| 631 |
# File: parsed.cfg |
| 632 |
# ---------------- |
| 633 |
# |
| 634 |
# interface GigabitEthernet0/1 |
| 635 |
# channel-group 11 mode active |
| 636 |
# interface GigabitEthernet0/2 |
| 637 |
# channel-group 22 mode passive |
| 638 |
|
| 639 |
- name: Parse the commands for provided configuration |
| 640 |
cisco.ios.ios_lag_interfaces: |
| 641 |
running_config: "{{ lookup('file', 'parsed.cfg') }}" |
| 642 |
state: parsed |
| 643 |
|
| 644 |
# Module Execution Result: |
| 645 |
# ------------------------ |
| 646 |
# |
| 647 |
# "parsed": [ |
| 648 |
# { |
| 649 |
# "members": [ |
| 650 |
# { |
| 651 |
# "member": "GigabitEthernet0/1", |
| 652 |
# "mode": "active" |
| 653 |
# } |
| 654 |
# ], |
| 655 |
# "name": "Port-channel11" |
| 656 |
# }, |
| 657 |
# { |
| 658 |
# "members": [ |
| 659 |
# { |
| 660 |
# "member": "GigabitEthernet0/2", |
| 661 |
# "mode": "passive" |
| 662 |
# } |
| 663 |
# ], |
| 664 |
# "name": "Port-channel22" |
| 665 |
# } |
| 666 |
# ] |
| 667 |
|
| 668 |
|
| 669 |
|
| 670 |
Return Values |
| 671 |
------------- |
| 672 |
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: |
| 673 |
|
| 674 |
.. raw:: html |
| 675 |
|
| 676 |
<table border=0 cellpadding=0 class="documentation-table"> |
| 677 |
<tr> |
| 678 |
<th colspan="1">Key</th> |
| 679 |
<th>Returned</th> |
| 680 |
<th width="100%">Description</th> |
| 681 |
</tr> |
| 682 |
<tr> |
| 683 |
<td colspan="1"> |
| 684 |
<div class="ansibleOptionAnchor" id="return-"></div> |
| 685 |
<b>after</b> |
| 686 |
<a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a> |
| 687 |
<div style="font-size: small"> |
| 688 |
<span style="color: purple">dictionary</span> |
| 689 |
</div> |
| 690 |
</td> |
| 691 |
<td>when changed</td> |
| 692 |
<td> |
| 693 |
<div>The resulting configuration after module execution.</div> |
| 694 |
<br/> |
| 695 |
<div style="font-size: smaller"><b>Sample:</b></div> |
| 696 |
<div style="font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;">This output will always be in the same format as the module argspec.</div> |
| 697 |
</td> |
| 698 |
</tr> |
| 699 |
<tr> |
| 700 |
<td colspan="1"> |
| 701 |
<div class="ansibleOptionAnchor" id="return-"></div> |
| 702 |
<b>before</b> |
| 703 |
<a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a> |
| 704 |
<div style="font-size: small"> |
| 705 |
<span style="color: purple">dictionary</span> |
| 706 |
</div> |
| 707 |
</td> |
| 708 |
<td>when <em>state</em> is <code>merged</code>, <code>replaced</code>, <code>overridden</code>, <code>deleted</code> or <code>purged</code></td> |
| 709 |
<td> |
| 710 |
<div>The configuration prior to the module execution.</div> |
| 711 |
<br/> |
| 712 |
<div style="font-size: smaller"><b>Sample:</b></div> |
| 713 |
<div style="font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;">This output will always be in the same format as the module argspec.</div> |
| 714 |
</td> |
| 715 |
</tr> |
| 716 |
<tr> |
| 717 |
<td colspan="1"> |
| 718 |
<div class="ansibleOptionAnchor" id="return-"></div> |
| 719 |
<b>commands</b> |
| 720 |
<a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a> |
| 721 |
<div style="font-size: small"> |
| 722 |
<span style="color: purple">list</span> |
| 723 |
</div> |
| 724 |
</td> |
| 725 |
<td>when <em>state</em> is <code>merged</code>, <code>replaced</code>, <code>overridden</code>, <code>deleted</code> or <code>purged</code></td> |
| 726 |
<td> |
| 727 |
<div>The set of commands pushed to the remote device.</div> |
| 728 |
<br/> |
| 729 |
<div style="font-size: smaller"><b>Sample:</b></div> |
| 730 |
<div style="font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;">['interface GigabitEthernet0/1', 'channel-group 10 mode auto', 'channel-group 10 mode active link 20']</div> |
| 731 |
</td> |
| 732 |
</tr> |
| 733 |
<tr> |
| 734 |
<td colspan="1"> |
| 735 |
<div class="ansibleOptionAnchor" id="return-"></div> |
| 736 |
<b>gathered</b> |
| 737 |
<a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a> |
| 738 |
<div style="font-size: small"> |
| 739 |
<span style="color: purple">list</span> |
| 740 |
</div> |
| 741 |
</td> |
| 742 |
<td>when <em>state</em> is <code>gathered</code></td> |
| 743 |
<td> |
| 744 |
<div>Facts about the network resource gathered from the remote device as structured data.</div> |
| 745 |
<br/> |
| 746 |
<div style="font-size: smaller"><b>Sample:</b></div> |
| 747 |
<div style="font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;">This output will always be in the same format as the module argspec.</div> |
| 748 |
</td> |
| 749 |
</tr> |
| 750 |
<tr> |
| 751 |
<td colspan="1"> |
| 752 |
<div class="ansibleOptionAnchor" id="return-"></div> |
| 753 |
<b>parsed</b> |
| 754 |
<a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a> |
| 755 |
<div style="font-size: small"> |
| 756 |
<span style="color: purple">list</span> |
| 757 |
</div> |
| 758 |
</td> |
| 759 |
<td>when <em>state</em> is <code>parsed</code></td> |
| 760 |
<td> |
| 761 |
<div>The device native config provided in <em>running_config</em> option parsed into structured data as per module argspec.</div> |
| 762 |
<br/> |
| 763 |
<div style="font-size: smaller"><b>Sample:</b></div> |
| 764 |
<div style="font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;">This output will always be in the same format as the module argspec.</div> |
| 765 |
</td> |
| 766 |
</tr> |
| 767 |
<tr> |
| 768 |
<td colspan="1"> |
| 769 |
<div class="ansibleOptionAnchor" id="return-"></div> |
| 770 |
<b>rendered</b> |
| 771 |
<a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a> |
| 772 |
<div style="font-size: small"> |
| 773 |
<span style="color: purple">list</span> |
| 774 |
</div> |
| 775 |
</td> |
| 776 |
<td>when <em>state</em> is <code>rendered</code></td> |
| 777 |
<td> |
| 778 |
<div>The provided configuration in the task rendered in device-native format (offline).</div> |
| 779 |
<br/> |
| 780 |
<div style="font-size: smaller"><b>Sample:</b></div> |
| 781 |
<div style="font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;">['interface GigabitEthernet0/2', 'channel-group 20 mode auto', 'channel-group 20 mode active link 60']</div> |
| 782 |
</td> |
| 783 |
</tr> |
| 784 |
</table> |
| 785 |
<br/><br/> |
| 786 |
|
| 787 |
|
| 788 |
Status |
| 789 |
------ |
| 790 |
|
| 791 |
|
| 792 |
Authors |
| 793 |
~~~~~~~ |
| 794 |
|
| 795 |
- Sagar Paul (@KB-perByte) |
| 796 |
- Sumit Jaiswal (@justjais) |