From c6ad676158b0328449b7e0775453c66c403c0d3d Mon Sep 17 00:00:00 2001 From: Vibhu-gslab Date: Fri, 13 Sep 2024 16:02:11 +0530 Subject: [PATCH] Refactor(eos_cli_config_gen): Remove primary key of system.control_plane.ipv4/6_access_group and make vrf key unique --- .../eos_cli_config_gen/documentation/devices/system.md | 4 ++++ .../eos_cli_config_gen/intended/configs/system.cfg | 2 ++ .../eos_cli_config_gen/inventory/host_vars/system.yml | 4 ++++ .../avd/roles/eos_cli_config_gen/docs/tables/system.md | 8 ++++---- .../schema/eos_cli_config_gen.schema.yml | 8 ++++++-- .../schema/schema_fragments/system.schema.yml | 8 ++++++-- 6 files changed, 26 insertions(+), 8 deletions(-) diff --git a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/system.md b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/system.md index 84dfe3f0699..feca39283ba 100644 --- a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/system.md +++ b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/system.md @@ -52,9 +52,11 @@ interface Management1 | -------- | --- | ------------| | IPv4 | default | acl4_1 | | IPv4 | red | acl4_2 | +| IPv4 | red_1 | acl4_2 | | IPv4 | default | acl4_3 | | IPv6 | default | acl6_1 | | IPv6 | blue | acl6_2 | +| IPv6 | blue_1 | acl6_2 | | IPv6 | default | acl6_3 | #### System Control-Plane Device Configuration @@ -65,9 +67,11 @@ system control-plane tcp mss ceiling ipv4 1344 ipv6 1366 ip access-group acl4_1 in ip access-group acl4_2 vrf red in + ip access-group acl4_2 vrf red_1 in ip access-group acl4_3 vrf default in ipv6 access-group acl6_1 in ipv6 access-group acl6_2 vrf blue in + ipv6 access-group acl6_2 vrf blue_1 in ipv6 access-group acl6_3 vrf default in ``` diff --git a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/intended/configs/system.cfg b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/intended/configs/system.cfg index 338748a3b3c..871af45d159 100644 --- a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/intended/configs/system.cfg +++ b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/intended/configs/system.cfg @@ -12,7 +12,9 @@ system control-plane tcp mss ceiling ipv4 1344 ipv6 1366 ip access-group acl4_1 in ip access-group acl4_2 vrf red in + ip access-group acl4_2 vrf red_1 in ip access-group acl4_3 vrf default in ipv6 access-group acl6_1 in ipv6 access-group acl6_2 vrf blue in + ipv6 access-group acl6_2 vrf blue_1 in ipv6 access-group acl6_3 vrf default in diff --git a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/system.yml b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/system.yml index f4dece89093..4158907f7cd 100644 --- a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/system.yml +++ b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/system.yml @@ -7,12 +7,16 @@ system: - acl_name: "acl4_1" - acl_name: "acl4_2" vrf: red + - acl_name: "acl4_2" + vrf: red_1 - acl_name: "acl4_3" vrf: default ipv6_access_groups: - acl_name: "acl6_1" - acl_name: "acl6_2" vrf: blue + - acl_name: "acl6_2" + vrf: blue_1 - acl_name: "acl6_3" vrf: default l1: diff --git a/ansible_collections/arista/avd/roles/eos_cli_config_gen/docs/tables/system.md b/ansible_collections/arista/avd/roles/eos_cli_config_gen/docs/tables/system.md index e8ba9fdb5f0..050f3ab4e68 100644 --- a/ansible_collections/arista/avd/roles/eos_cli_config_gen/docs/tables/system.md +++ b/ansible_collections/arista/avd/roles/eos_cli_config_gen/docs/tables/system.md @@ -13,10 +13,10 @@ | [      ipv4](## "system.control_plane.tcp_mss.ipv4") | Integer | | | | Segment size. | | [      ipv6](## "system.control_plane.tcp_mss.ipv6") | Integer | | | | Segment size. | | [    ipv4_access_groups](## "system.control_plane.ipv4_access_groups") | List, items: Dictionary | | | | | - | [      - acl_name](## "system.control_plane.ipv4_access_groups.[].acl_name") | String | Required, Unique | | | | + | [      - acl_name](## "system.control_plane.ipv4_access_groups.[].acl_name") | String | Required | | | | | [        vrf](## "system.control_plane.ipv4_access_groups.[].vrf") | String | | | | | | [    ipv6_access_groups](## "system.control_plane.ipv6_access_groups") | List, items: Dictionary | | | | | - | [      - acl_name](## "system.control_plane.ipv6_access_groups.[].acl_name") | String | Required, Unique | | | | + | [      - acl_name](## "system.control_plane.ipv6_access_groups.[].acl_name") | String | Required | | | | | [        vrf](## "system.control_plane.ipv6_access_groups.[].vrf") | String | | | | | | [  l1](## "system.l1") | Dictionary | | | | | | [    unsupported_speed_action](## "system.l1.unsupported_speed_action") | String | | | Valid Values:
- error
- warn | | @@ -35,10 +35,10 @@ # Segment size. ipv6: ipv4_access_groups: - - acl_name: + - acl_name: vrf: ipv6_access_groups: - - acl_name: + - acl_name: vrf: l1: unsupported_speed_action: diff --git a/python-avd/pyavd/_eos_cli_config_gen/schema/eos_cli_config_gen.schema.yml b/python-avd/pyavd/_eos_cli_config_gen/schema/eos_cli_config_gen.schema.yml index e7571fdc2b6..474822759d0 100644 --- a/python-avd/pyavd/_eos_cli_config_gen/schema/eos_cli_config_gen.schema.yml +++ b/python-avd/pyavd/_eos_cli_config_gen/schema/eos_cli_config_gen.schema.yml @@ -17779,24 +17779,28 @@ keys: description: Segment size. ipv4_access_groups: type: list - primary_key: acl_name + unique_keys: + - vrf items: type: dict keys: acl_name: type: str + required: true vrf: type: str convert_types: - int ipv6_access_groups: type: list - primary_key: acl_name + unique_keys: + - vrf items: type: dict keys: acl_name: type: str + required: true vrf: type: str convert_types: diff --git a/python-avd/pyavd/_eos_cli_config_gen/schema/schema_fragments/system.schema.yml b/python-avd/pyavd/_eos_cli_config_gen/schema/schema_fragments/system.schema.yml index 9c7166e6fa2..c844c587a50 100644 --- a/python-avd/pyavd/_eos_cli_config_gen/schema/schema_fragments/system.schema.yml +++ b/python-avd/pyavd/_eos_cli_config_gen/schema/schema_fragments/system.schema.yml @@ -24,24 +24,28 @@ keys: description: Segment size. ipv4_access_groups: type: list - primary_key: acl_name + unique_keys: + - vrf items: type: dict keys: acl_name: type: str + required: true vrf: type: str convert_types: - int ipv6_access_groups: type: list - primary_key: acl_name + unique_keys: + - vrf items: type: dict keys: acl_name: type: str + required: true vrf: type: str convert_types: