dellemc.enterprise_sonic.sonic_prefix_lists module – prefix list configuration handling for SONiC
Note
This module is part of the dellemc.enterprise_sonic collection (version 2.0.0).
You might already have this collection installed if you are using the ansible
package.
It is not included in ansible-core
.
To check whether it is installed, run ansible-galaxy collection list
.
To install it, use: ansible-galaxy collection install dellemc.enterprise\_sonic
.
To use it in a playbook, specify: dellemc.enterprise_sonic.sonic_prefix_lists
.
New in dellemc.enterprise_sonic 2.0.0
Synopsis
This module provides configuration management for prefix list parameters on devices running SONiC.
Parameters
Parameter |
Comments |
---|---|
Specifies a list of prefix set configuration dictionaries |
|
Specifies the Address Family for addresses in the prefix list entries Choices:
|
|
Name of a prefix set (a list of prefix entries) |
|
A list of prefix entries |
|
Action to be taken for addresses matching this prefix entry Choices:
|
|
Minimum prefix length to be matched |
|
Maximum prefix length to be matched |
|
IPv4 or IPv6 prefix in A.B.C.D/LEN or A:B::C:D/LEN format |
|
Precedence for this prefix entry (unique within the prefix list) |
|
Specifies the type of configuration update to be performed on the device. For “merged”, merge specified attributes with existing configured attributes. For “deleted”, delete the specified attributes from exiting configuration. Choices:
|
Examples
# Using "merged" state to create initial configuration
#
# Before state:
# -------------
#
# sonic# show running-configuration ip prefix-list
# sonic#
# (No configuration present)
#
# -------------
#
- name: Merge initial prefix-list configuration
dellemc.enterprise_sonic.sonic_prefix_lists:
config:
- name: pfx1
afi: "ipv4"
prefixes:
- sequence: 10
prefix: "1.2.3.4/24"
action: "permit"
ge: 26
le: 30
state: merged
# After state:
# ------------
#
# sonic# show running-configuration ip prefix-list
# !
# ip prefix-list pfx1 seq 10 permit 1.2.3.4/24 ge 26 le 30
# ------------
#
# ***************************************************************
# Using "merged" state to update and add configuration
#
# Before state:
# ------------
#
# sonic# show running-configuration ip prefix-list
# !
# ip prefix-list pfx1 seq 10 permit 1.2.3.4/24 ge 26 le 30
#
# sonic# show running-configuration ipv6 prefix-list
# sonic#
# (no IPv6 prefix-list configuration present)
#
# ------------
#
- name: Merge additional prefix-list configuration
dellemc.enterprise_sonic.sonic_prefix_lists:
config:
- name: pfx1
afi: "ipv4"
prefixes:
- sequence: 20
action: "deny"
prefix: "1.2.3.12/26"
- sequence: 30
action: "permit"
prefix: "7.8.9.0/24"
- name: pfx6
afi: "ipv6"
prefixes:
- sequence: 25
action: "permit"
prefix: "40::300/124"
state: merged
# After state:
# ------------
#
# sonic# show running-configuration ip prefix-list
# !
# ip prefix-list pfx1 seq 10 permit 1.2.3.4/24 ge 26 le 30
# ip prefix-list pfx1 seq 20 deny 1.2.3.12/26
# ip prefix-list pfx1 seq 30 permit 7.8.9.0/24
#
# sonic# show running-configuration ipv6 prefix-list
# !
# ipv6 prefix-list pfx6 seq 25 permit 40::300/124
#
# ***************************************************************
# Using "deleted" state to remove configuration
#
# Before state:
# ------------
#
# sonic# show running-configuration ip prefix-list
# !
# ip prefix-list pfx1 seq 10 permit 1.2.3.4/24 ge 26 le 30
# ip prefix-list pfx1 seq 20 deny 1.2.3.12/26
# ip prefix-list pfx1 seq 30 permit 7.8.9.0/24
#
# sonic# show running-configuration ipv6 prefix-list
# !
# ipv6 prefix-list pfx6 seq 25 permit 40::300/124
#
# ------------
#
- name: Delete selected prefix-list configuration
dellemc.enterprise_sonic.sonic_prefix_lists:
config:
- name: pfx1
afi: "ipv4"
prefixes:
- sequence: 10
prefix: "1.2.3.4/24"
action: "permit"
ge: 26
le: 30
- sequence: 20
action: "deny"
prefix: "1.2.3.12/26"
- name: pfx6
afi: "ipv6"
prefixes:
- sequence: 25
action: "permit"
prefix: "40::300/124"
state: deleted
# After state:
# ------------
#
# sonic# show running-configuration ip prefix-list
# !
# ip prefix-list pfx1 seq 30 permit 7.8.9.0/24
#
# sonic# show running-configuration ipv6 prefix-list
# sonic#
# (no IPv6 prefix-list configuration present)
#
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
The resulting configuration model invocation. Returned: when changed Sample: |
|
The configuration prior to the model invocation. Returned: always Sample: |
|
The set of commands pushed to the remote device. Returned: always |