.. _vyos.rest.vyos_prefix_lists_module: *************************** vyos.rest.vyos_prefix_lists *************************** **Manage prefix-list configuration on VyOS devices using REST API** Version added: 1.0.0 .. contents:: :local: :depth: 1 Synopsis -------- - Manages IPv4 and IPv6 prefix lists on VyOS via the REST API. - Uses REST API (``connection=httpapi``) instead of CLI. Parameters ---------- .. raw:: html
Parameter Choices/Defaults Comments
config
list / elements=dictionary
List of prefix-list configurations grouped by address family.
afi
string / required
    Choices:
  • ipv4
  • ipv6
Address family identifier.
prefix_lists
list / elements=dictionary
Named prefix lists.
description
string
Prefix list description.
entries
list / elements=dictionary
Prefix list rules.
action
string
    Choices:
  • permit
  • deny
Permit or deny.
description
string
Rule description.
ge
integer
Minimum prefix length.
le
integer
Maximum prefix length.
prefix
string
Network prefix to match.
sequence
integer / required
Rule sequence number.
name
string / required
Prefix list name.
state
string
    Choices:
  • merged ←
  • replaced
  • overridden
  • deleted
  • gathered
Desired state of the prefix-list configuration.
merged adds or updates entries without removing existing ones.
replaced replaces each named prefix list mentioned in config.
overridden replaces all prefix lists for the given AFIs.
deleted removes prefix lists. Without config removes all.
gathered returns current configuration as structured data.

Notes ----- .. note:: - Requires ``ansible_connection=httpapi`` with the VyOS httpapi plugin. - ``ansible_network_os`` must be set to ``vyos.rest.vyos``. Examples -------- .. code-block:: yaml - name: Merge prefix list configuration vyos.rest.vyos_prefix_lists: config: - afi: ipv4 prefix_lists: - name: AnsibleIPv4PrefixList description: PL configured by ansible entries: - sequence: 2 action: permit prefix: 92.168.10.0/26 le: 32 - sequence: 3 action: deny prefix: 72.168.2.0/24 ge: 26 - afi: ipv6 prefix_lists: - name: AllowIPv6Prefix entries: - sequence: 5 action: permit prefix: 2001:db8:8000::/35 le: 37 state: merged - name: Delete all prefix lists vyos.rest.vyos_prefix_lists: state: deleted - name: Gather current prefix list configuration vyos.rest.vyos_prefix_lists: state: gathered Return Values ------------- Common return values are documented `here `_, the following are the fields unique to this module: .. raw:: html
Key Returned Description
after
list
when changed
Prefix list configuration after this module ran.

before
list
always
Prefix list configuration before this module ran.

commands
list
always
List of API command tuples sent to the device.

gathered
list
when state is gathered
Current prefix list configuration as structured data.

response
dictionary
when changes are applied
Raw API response.

saved
boolean
when changes are applied
Whether the config was saved after changes.



Status ------ Authors ~~~~~~~ - VyOS Community (@vyos)