Resource module to configure prefix lists.
Version added: 2.2.0
- This module configures and manages the attributes of prefix list on Cisco IOS.
Note
- Tested against Cisco IOSXE Version 17.3 on CML.
- This module works with connection
network_cli
. See https://docs.ansible.com/ansible/latest/network/user_guide/platform_ios.html
# Using deleted by Name
# Before state:
# -------------
#
# router-ios#sh running-config | section ^ip prefix-list|^ipv6 prefix-list
# ip prefix-list 10 description this is test description
# ip prefix-list 10 seq 5 deny 1.0.0.0/8 le 15
# ip prefix-list 10 seq 10 deny 35.0.0.0/8 ge 10
# ip prefix-list 10 seq 15 deny 12.0.0.0/8 ge 15
# ip prefix-list 10 seq 20 deny 14.0.0.0/8 ge 20 le 21
# ip prefix-list test description this is test
# ip prefix-list test seq 50 deny 12.0.0.0/8 ge 15
# ip prefix-list test_prefix description this is for prefix-list
# ip prefix-list test_prefix seq 5 deny 35.0.0.0/8 ge 10 le 15
# ip prefix-list test_prefix seq 10 deny 35.0.0.0/8 ge 20
# ipv6 prefix-list test_ipv6 description this is ipv6 prefix-list
# ipv6 prefix-list test_ipv6 seq 10 deny 2001:DB8:0:4::/64 ge 80
- name: Delete provided Prefix lists config by Prefix name
cisco.ios.ios_prefix_lists:
config:
- afi: ipv4
prefix_lists:
- name: 10
- name: test_prefix
state: deleted
# Task Output
# -------------
# before:
# - afi: ipv4
# prefix_lists:
# - description: this is test description
# entries:
# - action: deny
# le: 15
# prefix: 1.0.0.0/8
# sequence: 5
# - action: deny
# ge: 10
# prefix: 35.0.0.0/8
# sequence: 10
# - action: deny
# ge: 15
# prefix: 12.0.0.0/8
# sequence: 15
# - action: deny
# ge: 20
# le: 21
# prefix: 14.0.0.0/8
# sequence: 20
# name: '10'
# - description: this is test
# entries:
# - action: deny
# ge: 15
# prefix: 12.0.0.0/8
# sequence: 50
# name: test
# - description: this is for prefix-list
# entries:
# - action: deny
# ge: 10
# le: 15
# prefix: 35.0.0.0/8
# sequence: 5
# - action: deny
# ge: 20
# prefix: 35.0.0.0/8
# sequence: 10
# name: test_prefix
# - afi: ipv6
# prefix_lists:
# - description: this is ipv6 prefix-list
# entries:
# - action: deny
# ge: 80
# prefix: 2001:DB8:0:4::/64
# sequence: 10
# name: test_ipv6
# commands:
# - no ip prefix-list 10
# - no ip prefix-list test_prefix
# after:
# - afi: ipv4
# prefix_lists:
# - description: this is test
# entries:
# - action: deny
# ge: 15
# prefix: 12.0.0.0/8
# sequence: 50
# name: test
# - afi: ipv6
# prefix_lists:
# - description: this is ipv6 prefix-list
# entries:
# - action: deny
# ge: 80
# prefix: 2001:DB8:0:4::/64
# sequence: 10
# name: test_ipv6
# After state:
# ------------
# router-ios#sh running-config | section ^ip prefix-list|^ipv6 prefix-list
# ip prefix-list test description this is test
# ip prefix-list test seq 50 deny 12.0.0.0/8 ge 15
# ipv6 prefix-list test_ipv6 description this is ipv6 prefix-list
# ipv6 prefix-list test_ipv6 seq 10 deny 2001:DB8:0:4::/64 ge 80
# Using deleted by AFI
# Before state:
# -------------
#
# router-ios#sh running-config | section ^ip prefix-list|^ipv6 prefix-list
# ip prefix-list 10 description this is test description
# ip prefix-list 10 seq 5 deny 1.0.0.0/8 le 15
# ip prefix-list 10 seq 10 deny 35.0.0.0/8 ge 10
# ip prefix-list 10 seq 15 deny 12.0.0.0/8 ge 15
# ip prefix-list 10 seq 20 deny 14.0.0.0/8 ge 20 le 21
# ip prefix-list test description this is test
# ip prefix-list test seq 50 deny 12.0.0.0/8 ge 15
# ip prefix-list test_prefix description this is for prefix-list
# ip prefix-list test_prefix seq 5 deny 35.0.0.0/8 ge 10 le 15
# ip prefix-list test_prefix seq 10 deny 35.0.0.0/8 ge 20
# ipv6 prefix-list test_ipv6 description this is ipv6 prefix-list
# ipv6 prefix-list test_ipv6 seq 10 deny 2001:DB8:0:4::/64 ge 80
- name: Delete provided Prefix lists config by AFI
cisco.ios.ios_prefix_lists:
config:
- afi: ipv4
state: deleted
# Task Output
# -------------
# before:
# - afi: ipv4
# prefix_lists:
# - description: this is test description
# entries:
# - action: deny
# le: 15
# prefix: 1.0.0.0/8
# sequence: 5
# - action: deny
# ge: 10
# prefix: 35.0.0.0/8
# sequence: 10
# - action: deny
# ge: 15
# prefix: 12.0.0.0/8
# sequence: 15
# - action: deny
# ge: 20
# le: 21
# prefix: 14.0.0.0/8
# sequence: 20
# name: '10'
# - description: this is test
# entries:
# - action: deny
# ge: 15
# prefix: 12.0.0.0/8
# sequence: 50
# name: test
# - description: this is for prefix-list
# entries:
# - action: deny
# ge: 10
# le: 15
# prefix: 35.0.0.0/8
# sequence: 5
# - action: deny
# ge: 20
# prefix: 35.0.0.0/8
# sequence: 10
# name: test_prefix
# - afi: ipv6
# prefix_lists:
# - description: this is ipv6 prefix-list
# entries:
# - action: deny
# ge: 80
# prefix: 2001:DB8:0:4::/64
# sequence: 10
# name: test_ipv6
# commands:
# - "no ip prefix-list test",
# - "no ip prefix-list 10",
# - "no ip prefix-list test_prefix"
# after:
# - afi: ipv6
# prefix_lists:
# - description: this is ipv6 prefix-list
# entries:
# - action: deny
# ge: 80
# prefix: 2001:DB8:0:4::/64
# sequence: 10
# name: test_ipv6
# After state:
# -------------
# router-ios#sh running-config | section ^ip prefix-list|^ipv6 prefix-list
# ipv6 prefix-list test_ipv6 description this is ipv6 prefix-list
# ipv6 prefix-list test_ipv6 seq 10 deny 2001:DB8:0:4::/64 ge 80
# Using deleted without any config passed (NOTE: This will delete all Prefix lists configuration from device)
# Before state:
# -------------
#
# router-ios#sh running-config | section ^ip prefix-list|^ipv6 prefix-list
# ip prefix-list 10 description this is test description
# ip prefix-list 10 seq 5 deny 1.0.0.0/8 le 15
# ip prefix-list 10 seq 10 deny 35.0.0.0/8 ge 10
# ip prefix-list 10 seq 15 deny 12.0.0.0/8 ge 15
# ip prefix-list 10 seq 20 deny 14.0.0.0/8 ge 20 le 21
# ip prefix-list test description this is test
# ip prefix-list test seq 50 deny 12.0.0.0/8 ge 15
# ip prefix-list test_prefix description this is for prefix-list
# ip prefix-list test_prefix seq 5 deny 35.0.0.0/8 ge 10 le 15
# ip prefix-list test_prefix seq 10 deny 35.0.0.0/8 ge 20
# ipv6 prefix-list test_ipv6 description this is ipv6 prefix-list
# ipv6 prefix-list test_ipv6 seq 10 deny 2001:DB8:0:4::/64 ge 80
- name: Delete all Prefix lists config
cisco.ios.ios_prefix_lists:
state: deleted
# Commands Fired:
# ---------------
#
# "commands": [
# "no ip prefix-list test",
# "no ip prefix-list 10",
# "no ip prefix-list test_prefix",
# "no ipv6 prefix-list test_ipv6"
# ]
# After state:
# -------------
# router-ios#sh running-config | section ^ip prefix-list|^ipv6 prefix-list
# router-ios#
# Using merged
# Before state:
# -------------
#
# router-ios#sh running-config | section ^ip prefix-list|^ipv6 prefix-list
# ipv6 prefix-list test_ipv6 description this is ipv6
# ipv6 prefix-list test_ipv6 seq 10 deny 2001:DB8:0:4::/64 ge 80
- name: Merge provided Prefix lists configuration
cisco.ios.ios_prefix_lists:
config:
- afi: ipv6
prefix_lists:
- name: test_ipv6
description: this is ipv6 merge test
entries:
- action: deny
prefix: 2001:DB8:0:4::/64
ge: 80
le: 100
sequence: 10
state: merged
# After state:
# -------------
#
# Play Execution fails, with error:
# Cannot update existing sequence 10 of Prefix Lists test_ipv6 with state merged.
# Please use state replaced or overridden.
# Before state:
# -------------
#
# router-ios#sh running-config | section ^ip prefix-list|^ipv6 prefix-list
# ipv6 prefix-list test_ipv6 description this is ipv6
# ipv6 prefix-list test_ipv6 seq 10 deny 2001:DB8:0:4::/64 ge 80
- name: Merge provided Prefix lists configuration
cisco.ios.ios_prefix_lists:
config:
- afi: ipv4
prefix_lists:
- name: 10
description: this is new merge test
entries:
- action: deny
prefix: 1.0.0.0/8
le: 15
sequence: 5
- action: deny
prefix: 35.0.0.0/8
ge: 10
sequence: 10
- action: deny
prefix: 12.0.0.0/8
ge: 15
sequence: 15
- action: deny
prefix: 14.0.0.0/8
ge: 20
le: 21
sequence: 20
- name: test
description: this is merge test
entries:
- action: deny
prefix: 12.0.0.0/8
ge: 15
sequence: 50
- name: test_prefix
description: this is for prefix-list
entries:
- action: deny
prefix: 35.0.0.0/8
ge: 10
le: 15
sequence: 5
- action: deny
prefix: 35.0.0.0/8
ge: 20
sequence: 10
- afi: ipv6
prefix_lists:
- name: test_ipv6
description: this is ipv6 merge test
entries:
- action: deny
prefix: 2001:DB8:0:4::/64
ge: 80
le: 100
sequence: 20
state: merged
# Commands Fired:
# ---------------
#
# "commands": [
# "ip prefix-list test description this is merge test",
# "ip prefix-list test seq 50 deny 12.0.0.0/8 ge 15",
# "ip prefix-list 10 seq 15 deny 12.0.0.0/8 ge 15",
# "ip prefix-list 10 seq 10 deny 35.0.0.0/8 ge 10",
# "ip prefix-list 10 seq 5 deny 1.0.0.0/8 le 15",
# "ip prefix-list 10 description this is new merge test",
# "ip prefix-list 10 seq 20 deny 14.0.0.0/8 ge 20 le 21",
# "ip prefix-list test_prefix seq 10 deny 35.0.0.0/8 ge 20",
# "ip prefix-list test_prefix seq 5 deny 35.0.0.0/8 ge 10 le 15",
# "ip prefix-list test_prefix description this is for prefix-list",
# "ipv6 prefix-list test_ipv6 seq 20 deny 2001:DB8:0:4::/64 ge 80 le 100",
# "ipv6 prefix-list test_ipv6 description this is ipv6 merge test"
# ]
# After state:
# -------------
#
# router-ios#sh running-config | section ^ip prefix-list|^ipv6 prefix-list
# ip prefix-list 10 description this is new merge test
# ip prefix-list 10 seq 5 deny 1.0.0.0/8 le 15
# ip prefix-list 10 seq 10 deny 35.0.0.0/8 ge 10
# ip prefix-list 10 seq 15 deny 12.0.0.0/8 ge 15
# ip prefix-list 10 seq 20 deny 14.0.0.0/8 ge 20 le 21
# ip prefix-list test description this is merge test
# ip prefix-list test seq 50 deny 12.0.0.0/8 ge 15
# ip prefix-list test_prefix description this is for prefix-list
# ip prefix-list test_prefix seq 5 deny 35.0.0.0/8 ge 10 le 15
# ip prefix-list test_prefix seq 10 deny 35.0.0.0/8 ge 20
# ipv6 prefix-list test_ipv6 description this is ipv6 merge test
# ipv6 prefix-list test_ipv6 seq 10 deny 2001:DB8:0:4::/64 ge 80 le 100
# Using overridden
# Before state:
# -------------
#
# router-ios#sh running-config | section ^ip prefix-list|^ipv6 prefix-list
# ip prefix-list 10 description this is test description
# ip prefix-list 10 seq 5 deny 1.0.0.0/8 le 15
# ip prefix-list 10 seq 10 deny 35.0.0.0/8 ge 10
# ip prefix-list 10 seq 15 deny 12.0.0.0/8 ge 15
# ip prefix-list 10 seq 20 deny 14.0.0.0/8 ge 20 le 21
# ip prefix-list test description this is test
# ip prefix-list test seq 50 deny 12.0.0.0/8 ge 15
# ip prefix-list test_prefix description this is for prefix-list
# ip prefix-list test_prefix seq 5 deny 35.0.0.0/8 ge 10 le 15
# ip prefix-list test_prefix seq 10 deny 35.0.0.0/8 ge 20
# ipv6 prefix-list test_ipv6 description this is ipv6 prefix-list
# ipv6 prefix-list test_ipv6 seq 10 deny 2001:DB8:0:4::/64 ge 80
- name: Override provided Prefix lists configuration
cisco.ios.ios_prefix_lists:
config:
- afi: ipv4
prefix_lists:
- name: 10
description: this is override test
entries:
- action: deny
prefix: 12.0.0.0/8
ge: 15
sequence: 15
- action: deny
prefix: 14.0.0.0/8
ge: 20
le: 21
sequence: 20
- name: test_override
description: this is override test
entries:
- action: deny
prefix: 35.0.0.0/8
ge: 20
sequence: 10
- afi: ipv6
prefix_lists:
- name: test_ipv6
description: this is ipv6 override test
entries:
- action: deny
prefix: 2001:DB8:0:4::/64
ge: 80
le: 100
sequence: 10
state: overridden
# Commands Fired:
# ---------------
#
# "commands": [
# "no ip prefix-list test",
# "no ip prefix-list test_prefix",
# "ip prefix-list 10 description this is override test",
# "no ip prefix-list 10 seq 10 deny 35.0.0.0/8 ge 10",
# "no ip prefix-list 10 seq 5 deny 1.0.0.0/8 le 15",
# "ip prefix-list test_override seq 10 deny 35.0.0.0/8 ge 20",
# "ip prefix-list test_override description this is override test",
# "no ipv6 prefix-list test_ipv6 seq 10 deny 2001:DB8:0:4::/64 ge 80",
# "ipv6 prefix-list test_ipv6 seq 10 deny 2001:DB8:0:4::/64 ge 80 le 100",
# "ipv6 prefix-list test_ipv6 description this is ipv6 override test"
# ]
# After state:
# -------------
#
# router-ios#sh running-config | section ^ip prefix-list|^ipv6 prefix-list
# ip prefix-list 10 description this is override test
# ip prefix-list 10 seq 15 deny 12.0.0.0/8 ge 15
# ip prefix-list 10 seq 20 deny 14.0.0.0/8 ge 20 le 21
# ip prefix-list test_override description this is override test
# ip prefix-list test_override seq 10 deny 35.0.0.0/8 ge 20
# ipv6 prefix-list test_ipv6 description this is ipv6 override test
# ipv6 prefix-list test_ipv6 seq 10 deny 2001:DB8:0:4::/64 ge 80 le 100
# Using replaced
# Before state:
# -------------
#
# router-ios#sh running-config | section ^ip prefix-list|^ipv6 prefix-list
# ip prefix-list 10 description this is test description
# ip prefix-list 10 seq 5 deny 1.0.0.0/8 le 15
# ip prefix-list 10 seq 10 deny 35.0.0.0/8 ge 10
# ip prefix-list 10 seq 15 deny 12.0.0.0/8 ge 15
# ip prefix-list 10 seq 20 deny 14.0.0.0/8 ge 20 le 21
# ip prefix-list test description this is test
# ip prefix-list test seq 50 deny 12.0.0.0/8 ge 15
# ip prefix-list test_prefix description this is for prefix-list
# ip prefix-list test_prefix seq 5 deny 35.0.0.0/8 ge 10 le 15
# ip prefix-list test_prefix seq 10 deny 35.0.0.0/8 ge 20
# ipv6 prefix-list test_ipv6 description this is ipv6 prefix-list
# ipv6 prefix-list test_ipv6 seq 10 deny 2001:DB8:0:4::/64 ge 80
- name: Replaced provided Prefix lists configuration
cisco.ios.ios_prefix_lists:
config:
- afi: ipv4
prefix_lists:
- name: 10
description: this is replace test
entries:
- action: deny
prefix: 12.0.0.0/8
ge: 15
sequence: 15
- action: deny
prefix: 14.0.0.0/8
ge: 20
le: 21
sequence: 20
- name: test_replace
description: this is replace test
entries:
- action: deny
prefix: 35.0.0.0/8
ge: 20
sequence: 10
- afi: ipv6
prefix_lists:
- name: test_ipv6
description: this is ipv6 replace test
entries:
- action: deny
prefix: 2001:DB8:0:4::/64
ge: 80
le: 100
sequence: 10
state: replaced
# Commands Fired:
# ---------------
# "commands": [
# "ip prefix-list 10 description this is replace test",
# "no ip prefix-list 10 seq 10 deny 35.0.0.0/8 ge 10",
# "no ip prefix-list 10 seq 5 deny 1.0.0.0/8 le 15",
# "ip prefix-list test_replace seq 10 deny 35.0.0.0/8 ge 20",
# "ip prefix-list test_replace description this is replace test",
# "no ipv6 prefix-list test_ipv6 seq 10 deny 2001:DB8:0:4::/64 ge 80",
# "ipv6 prefix-list test_ipv6 seq 10 deny 2001:DB8:0:4::/64 ge 80 le 100",
# "ipv6 prefix-list test_ipv6 description this is ipv6 replace test"
# ]
# After state:
# -------------
#
# router-ios#sh running-config | section ^ip prefix-list|^ipv6 prefix-list
# ip prefix-list 10 description this is replace test
# ip prefix-list 10 seq 15 deny 12.0.0.0/8 ge 15
# ip prefix-list 10 seq 20 deny 14.0.0.0/8 ge 20 le 21
# ip prefix-list test description this is test
# ip prefix-list test seq 50 deny 12.0.0.0/8 ge 15
# ip prefix-list test_prefix description this is for prefix-list
# ip prefix-list test_prefix seq 5 deny 35.0.0.0/8 ge 10 le 15
# ip prefix-list test_prefix seq 10 deny 35.0.0.0/8 ge 20
# ip prefix-list test_replace description this is replace test
# ip prefix-list test_replace seq 10 deny 35.0.0.0/8 ge 20
# ipv6 prefix-list test_ipv6 description this is ipv6 replace test
# ipv6 prefix-list test_ipv6 seq 10 deny 2001:DB8:0:4::/64 ge 80 le 100
# Using Gathered
# Before state:
# -------------
#
# router-ios#sh running-config | section ^ip prefix-list|^ipv6 prefix-list
# ip prefix-list 10 description this is test description
# ip prefix-list 10 seq 5 deny 1.0.0.0/8 le 15
# ip prefix-list 10 seq 10 deny 35.0.0.0/8 ge 10
# ip prefix-list 10 seq 15 deny 12.0.0.0/8 ge 15
# ip prefix-list 10 seq 20 deny 14.0.0.0/8 ge 20 le 21
# ip prefix-list test description this is test
# ip prefix-list test seq 50 deny 12.0.0.0/8 ge 15
# ip prefix-list test_prefix description this is for prefix-list
# ip prefix-list test_prefix seq 5 deny 35.0.0.0/8 ge 10 le 15
# ip prefix-list test_prefix seq 10 deny 35.0.0.0/8 ge 20
# ipv6 prefix-list test_ipv6 description this is ipv6 prefix-list
# ipv6 prefix-list test_ipv6 seq 10 deny 2001:DB8:0:4::/64 ge 80
- name: Gather Prefix lists provided configurations
cisco.ios.ios_prefix_lists:
config:
state: gathered
# Module Execution Result:
# ------------------------
#
# "gathered": [
# {
# "afi": "ipv4",
# "prefix_lists": [
# {
# "description": "this is test description"
# "entries": [
# {
# "action": "deny",
# "le": 15,
# "prefix": "1.0.0.0/8",
# "sequence": 5
# },
# {
# "action": "deny",
# "ge": 10,
# "prefix": "35.0.0.0/8",
# "sequence": 10
# },
# {
# "action": "deny",
# "ge": 15,
# "prefix": "12.0.0.0/8",
# "sequence": 15
# },
# {
# "action": "deny",
# "ge": 20,
# "le": 21,
# "prefix": "14.0.0.0/8",
# "sequence": 20
# }
# ],
# "name": "10"
# },
# {
# "description": "this is test"
# "entries": [
# {
# "action": "deny",
# "ge": 15,
# "prefix": "12.0.0.0/8",
# "sequence": 50
# }
# ],
# "name": "test"
# },
# {
# "description": "this is for prefix-list"
# "entries": [
# {
# "action": "deny",
# "ge": 10,
# "le": 15,
# "prefix": "35.0.0.0/8",
# "sequence": 5
# },
# {
# "action": "deny",
# "ge": 20,
# "prefix": "35.0.0.0/8",
# "sequence": 10
# }
# ],
# "name": "test_prefix"
# }
# ]
# },
# {
# "afi": "ipv6",
# "prefix_lists": [
# {
# "description": "this is ipv6 prefix-list"
# "entries": [
# {
# "action": "deny",
# "ge": 80,
# "prefix": "2001:DB8:0:4::/64",
# "sequence": 10
# }
# ],
# "name": "test_ipv6"
# }
# ]
# }
# ]
# After state:
# ------------
#
# router-ios#sh running-config | section ^ip prefix-list|^ipv6 prefix-list
# ip prefix-list 10 description this is test description
# ip prefix-list 10 seq 5 deny 1.0.0.0/8 le 15
# ip prefix-list 10 seq 10 deny 35.0.0.0/8 ge 10
# ip prefix-list 10 seq 15 deny 12.0.0.0/8 ge 15
# ip prefix-list 10 seq 20 deny 14.0.0.0/8 ge 20 le 21
# ip prefix-list test description this is test
# ip prefix-list test seq 50 deny 12.0.0.0/8 ge 15
# ip prefix-list test_prefix description this is for prefix-list
# ip prefix-list test_prefix seq 5 deny 35.0.0.0/8 ge 10 le 15
# ip prefix-list test_prefix seq 10 deny 35.0.0.0/8 ge 20
# ipv6 prefix-list test_ipv6 description this is ipv6 prefix-list
# ipv6 prefix-list test_ipv6 seq 10 deny 2001:DB8:0:4::/64 ge 80
# Using Rendered
- name: Render the commands for provided configuration
cisco.ios.ios_prefix_lists:
config:
- afi: ipv4
prefix_lists:
- name: 10
description: this is new merge test
entries:
- action: deny
prefix: 1.0.0.0/8
le: 15
sequence: 5
- action: deny
prefix: 35.0.0.0/8
ge: 10
sequence: 10
- action: deny
prefix: 12.0.0.0/8
ge: 15
sequence: 15
- action: deny
prefix: 14.0.0.0/8
ge: 20
le: 21
sequence: 20
- name: test
description: this is merge test
entries:
- action: deny
prefix: 12.0.0.0/8
ge: 15
sequence: 50
- name: test_prefix
description: this is for prefix-list
entries:
- action: deny
prefix: 35.0.0.0/8
ge: 10
le: 15
sequence: 5
- action: deny
prefix: 35.0.0.0/8
ge: 20
sequence: 10
- afi: ipv6
prefix_lists:
- name: test_ipv6
description: this is ipv6 merge test
entries:
- action: deny
prefix: 2001:DB8:0:4::/64
ge: 80
le: 100
sequence: 10
state: rendered
# Module Execution Result:
# ------------------------
#
# "rendered": [
# "ip prefix-list test description this is test",
# "ip prefix-list test seq 50 deny 12.0.0.0/8 ge 15",
# "ip prefix-list 10 seq 15 deny 12.0.0.0/8 ge 15",
# "ip prefix-list 10 seq 10 deny 35.0.0.0/8 ge 10",
# "ip prefix-list 10 seq 5 deny 1.0.0.0/8 le 15",
# "ip prefix-list 10 description this is test description",
# "ip prefix-list 10 seq 20 deny 14.0.0.0/8 ge 20 le 21",
# "ip prefix-list test_prefix seq 10 deny 35.0.0.0/8 ge 20",
# "ip prefix-list test_prefix seq 5 deny 35.0.0.0/8 ge 10 le 15",
# "ip prefix-list test_prefix description this is for prefix-list",
# "ipv6 prefix-list test_ipv6 seq 10 deny 2001:DB8:0:4::/64 ge 80 l2 100",
# "ipv6 prefix-list test_ipv6 description this is ipv6 prefix-list"
# ]
# Using Parsed
# File: parsed.cfg
# ----------------
#
# ip prefix-list 10 description this is test description
# ip prefix-list 10 seq 5 deny 1.0.0.0/8 le 15
# ip prefix-list 10 seq 10 deny 35.0.0.0/8 ge 10
# ip prefix-list 10 seq 15 deny 12.0.0.0/8 ge 15
# ip prefix-list 10 seq 20 deny 14.0.0.0/8 ge 20 le 21
# ip prefix-list test description this is test
# ip prefix-list test seq 50 deny 12.0.0.0/8 ge 15
# ip prefix-list test_prefix description this is for prefix-list
# ip prefix-list test_prefix seq 5 deny 35.0.0.0/8 ge 10 le 15
# ip prefix-list test_prefix seq 10 deny 35.0.0.0/8 ge 20
# ipv6 prefix-list test_ipv6 description this is ipv6 prefix-list
# ipv6 prefix-list test_ipv6 seq 10 deny 2001:DB8:0:4::/64 ge 80
- name: Parse the provided configuration with the existing running configuration
cisco.ios.ios_prefix_lists:
running_config: "{{ lookup('file', 'parsed.cfg') }}"
state: parsed
# Module Execution Result:
# ------------------------
#
# "parsed": [
# {
# "afi": "ipv4",
# "prefix_lists": [
# {
# "description": "this is test description"
# "entries": [
# {
# "action": "deny",
# "le": 15,
# "prefix": "1.0.0.0/8",
# "sequence": 5
# },
# {
# "action": "deny",
# "ge": 10,
# "prefix": "35.0.0.0/8",
# "sequence": 10
# },
# {
# "action": "deny",
# "ge": 15,
# "prefix": "12.0.0.0/8",
# "sequence": 15
# },
# {
# "action": "deny",
# "ge": 20,
# "le": 21,
# "prefix": "14.0.0.0/8",
# "sequence": 20
# }
# ],
# "name": "10"
# },
# {
# "description": "this is test"
# "entries": [
# {
# "action": "deny",
# "ge": 15,
# "prefix": "12.0.0.0/8",
# "sequence": 50
# }
# ],
# "name": "test"
# },
# {
# "description": "this is for prefix-list"
# "entries": [
# {
# "action": "deny",
# "ge": 10,
# "le": 15,
# "prefix": "35.0.0.0/8",
# "sequence": 5
# },
# {
# "action": "deny",
# "ge": 20,
# "prefix": "35.0.0.0/8",
# "sequence": 10
# }
# ],
# "name": "test_prefix"
# }
# ]
# },
# {
# "afi": "ipv6",
# "prefix_lists": [
# {
# "description": "this is ipv6 prefix-list"
# "entries": [
# {
# "action": "deny",
# "ge": 80,
# "prefix": "2001:DB8:0:4::/64",
# "sequence": 10
# }
# ],
# "name": "test_ipv6"
# }
# ]
# }
# ]
Common return values are documented here, the following are the fields unique to this module:
- Sagar Paul (@KB-perByte)
- Sumit Jaiswal (@justjais)