From 6dc9d721513dca5a573c7ee01b74d703ff41f95f Mon Sep 17 00:00:00 2001 From: omnom62 <75066712+omnom62@users.noreply.github.com> Date: Fri, 21 Aug 2026 23:41:34 +1000 Subject: T8989: prefix_lists module * prefix_lists module * prefix_lists module rst * t8989 prefix_lists module * Converage tests fixes * T8989: SIT updates --- docs/vyos.rest.vyos_prefix_lists_module.rst | 454 ++++++++++++++++++++++++++++ 1 file changed, 454 insertions(+) create mode 100644 docs/vyos.rest.vyos_prefix_lists_module.rst (limited to 'docs') diff --git a/docs/vyos.rest.vyos_prefix_lists_module.rst b/docs/vyos.rest.vyos_prefix_lists_module.rst new file mode 100644 index 0000000..53321c9 --- /dev/null +++ b/docs/vyos.rest.vyos_prefix_lists_module.rst @@ -0,0 +1,454 @@ +.. _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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterChoices/DefaultsComments
+
+ 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
KeyReturnedDescription
+
+ 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) -- cgit v1.2.3