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