From ade432180f0b84a258c178ec4847b540fee217b2 Mon Sep 17 00:00:00 2001 From: dhayes Date: Tue, 19 Nov 2024 22:06:25 +1100 Subject: [PATCH 01/11] adding support for make_before_break --- .../documentation/devices/host1.md | 4 ++++ .../eos_cli_config_gen/intended/configs/host1.cfg | 2 ++ .../host_vars/host1/router-pim-sparse-mode.yml | 2 ++ .../docs/tables/router-pim-sparse-mode.md | 8 ++++++++ .../documentation/router-pim-sparse-mode.j2 | 2 ++ .../j2templates/eos/router-pim-sparse-mode.j2 | 14 ++++++++++++++ .../schema/eos_cli_config_gen.schema.yml | 6 ++++++ .../router_pim_sparse_mode.schema.yml | 6 ++++++ 8 files changed, 44 insertions(+) diff --git a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/host1.md b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/host1.md index cc723a80616..06c74d57f46 100644 --- a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/host1.md +++ b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/host1.md @@ -5854,6 +5854,8 @@ router multicast BFD enabled: True +Make-before-break: False + ##### IP Rendezvous Information | Rendezvous Point Address | Group Address | Access Lists | Priority | Hashmask | Override | @@ -5890,6 +5892,7 @@ router pim sparse-mode ipv4 ssm range standard bfd + make-before-break disabled rp address 10.238.1.161 239.12.12.12/32 priority 20 rp address 10.238.1.161 239.12.12.13/32 priority 20 rp address 10.238.1.161 239.12.12.14/32 priority 20 @@ -5905,6 +5908,7 @@ router pim sparse-mode vrf MCAST_VRF1 ipv4 bfd + make-before-break disabled rp address 10.238.2.161 239.12.22.12/32 rp address 10.238.2.161 239.12.22.13/32 rp address 10.238.2.161 239.12.22.14/32 diff --git a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/intended/configs/host1.cfg b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/intended/configs/host1.cfg index 7f0ea8a15e5..e26d053fe5f 100644 --- a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/intended/configs/host1.cfg +++ b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/intended/configs/host1.cfg @@ -3777,6 +3777,7 @@ router pim sparse-mode ipv4 ssm range standard bfd + make-before-break disabled rp address 10.238.1.161 239.12.12.12/32 priority 20 rp address 10.238.1.161 239.12.12.13/32 priority 20 rp address 10.238.1.161 239.12.12.14/32 priority 20 @@ -3792,6 +3793,7 @@ router pim sparse-mode vrf MCAST_VRF1 ipv4 bfd + make-before-break disabled rp address 10.238.2.161 239.12.22.12/32 rp address 10.238.2.161 239.12.22.13/32 rp address 10.238.2.161 239.12.22.14/32 diff --git a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/host1/router-pim-sparse-mode.yml b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/host1/router-pim-sparse-mode.yml index 466d941c846..501d6844df7 100644 --- a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/host1/router-pim-sparse-mode.yml +++ b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/host1/router-pim-sparse-mode.yml @@ -4,6 +4,7 @@ router_pim_sparse_mode: ipv4: bfd: true + make_before_break: false rp_addresses: - address: 10.238.1.161 groups: @@ -32,6 +33,7 @@ router_pim_sparse_mode: - name: MCAST_VRF1 ipv4: bfd: true + make_before_break: false rp_addresses: - address: 10.238.2.161 groups: diff --git a/ansible_collections/arista/avd/roles/eos_cli_config_gen/docs/tables/router-pim-sparse-mode.md b/ansible_collections/arista/avd/roles/eos_cli_config_gen/docs/tables/router-pim-sparse-mode.md index 37224d0c93e..8fbf1bcf33b 100644 --- a/ansible_collections/arista/avd/roles/eos_cli_config_gen/docs/tables/router-pim-sparse-mode.md +++ b/ansible_collections/arista/avd/roles/eos_cli_config_gen/docs/tables/router-pim-sparse-mode.md @@ -10,6 +10,7 @@ | [router_pim_sparse_mode](## "router_pim_sparse_mode") | Dictionary | | | | | | [  ipv4](## "router_pim_sparse_mode.ipv4") | Dictionary | | | | | | [    bfd](## "router_pim_sparse_mode.ipv4.bfd") | Boolean | | | | Enable/Disable BFD. | + | [    make_before_break](## "router_pim_sparse_mode.ipv4.make_before_break") | Boolean | | | | Enable/Disable Make-Before-Break. | | [    ssm_range](## "router_pim_sparse_mode.ipv4.ssm_range") | String | | | | IPv4 Prefix associated with SSM. | | [    rp_addresses](## "router_pim_sparse_mode.ipv4.rp_addresses") | List, items: Dictionary | | | | | | [      - address](## "router_pim_sparse_mode.ipv4.rp_addresses.[].address") | String | Required | | | RP Address. | @@ -29,6 +30,7 @@ | [    - name](## "router_pim_sparse_mode.vrfs.[].name") | String | Required, Unique | | | VRF Name. | | [      ipv4](## "router_pim_sparse_mode.vrfs.[].ipv4") | Dictionary | | | | | | [        bfd](## "router_pim_sparse_mode.vrfs.[].ipv4.bfd") | Boolean | | | | Enable/Disable BFD. | + | [        make_before_break](## "router_pim_sparse_mode.vrfs.[].ipv4.make_before_break") | Boolean | | | | Enable/Disable Make-Before-Break. | | [        rp_addresses](## "router_pim_sparse_mode.vrfs.[].ipv4.rp_addresses") | List, items: Dictionary | | | | | | [          - address](## "router_pim_sparse_mode.vrfs.[].ipv4.rp_addresses.[].address") | String | Required | | | RP Address. | | [            groups](## "router_pim_sparse_mode.vrfs.[].ipv4.rp_addresses.[].groups") | List, items: String | | | | | @@ -48,6 +50,9 @@ # Enable/Disable BFD. bfd: + # Enable/Disable Make-Before-Break. + make_before_break: + # IPv4 Prefix associated with SSM. ssm_range: rp_addresses: @@ -78,6 +83,9 @@ # Enable/Disable BFD. bfd: + + # Enable/Disable Make-Before-Break. + make_before_break: rp_addresses: # RP Address. diff --git a/python-avd/pyavd/_eos_cli_config_gen/j2templates/documentation/router-pim-sparse-mode.j2 b/python-avd/pyavd/_eos_cli_config_gen/j2templates/documentation/router-pim-sparse-mode.j2 index 4c58ba50057..179d128ec3e 100644 --- a/python-avd/pyavd/_eos_cli_config_gen/j2templates/documentation/router-pim-sparse-mode.j2 +++ b/python-avd/pyavd/_eos_cli_config_gen/j2templates/documentation/router-pim-sparse-mode.j2 @@ -14,6 +14,8 @@ BFD enabled: {{ router_pim_sparse_mode.ipv4.bfd | arista.avd.default(false) }} {% if router_pim_sparse_mode.ipv4.rp_addresses is arista.avd.defined %} +Make-before-break: {{ router_pim_sparse_mode.ipv4.make_before_break }} + ##### IP Rendezvous Information | Rendezvous Point Address | Group Address | Access Lists | Priority | Hashmask | Override | diff --git a/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/router-pim-sparse-mode.j2 b/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/router-pim-sparse-mode.j2 index 84875e9ae39..4b0462dfcf6 100644 --- a/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/router-pim-sparse-mode.j2 +++ b/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/router-pim-sparse-mode.j2 @@ -15,6 +15,13 @@ router pim sparse-mode {% if router_pim_sparse_mode.ipv4.bfd is arista.avd.defined(true) %} bfd {% endif %} +{% if router_pim_sparse_mode.ipv4.make_before_break is arista.avd.defined %} +{% if router_pim_sparse_mode.ipv4.make_before_break: %} + make-before-break +{% else %} + make-before-break disabled +{% endif %} +{% endif %} {% for rp_address in router_pim_sparse_mode.ipv4.rp_addresses | arista.avd.natural_sort('address') %} {% set rp_options_cli = "" %} {% if rp_address.priority is arista.avd.defined %} @@ -59,6 +66,13 @@ router pim sparse-mode {% if vrf.ipv4.bfd is arista.avd.defined(true) %} bfd {% endif %} +{% if vrf.ipv4.make_before_break is arista.avd.defined %} +{% if vrf.ipv4.make_before_break: %} + make-before-break +{% else %} + make-before-break disabled +{% endif %} +{% endif %} {% for rp_address in vrf.ipv4.rp_addresses | arista.avd.natural_sort('address') %} {% set rp_options_cli = "" %} {% if rp_address.priority is arista.avd.defined %} 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 30ded4736ae..561e93f2fa1 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 @@ -19418,6 +19418,9 @@ keys: bfd: type: bool description: Enable/Disable BFD. + make_before_break: + type: bool + description: Enable/Disable Make-Before-Break. ssm_range: type: str description: IPv4 Prefix associated with SSM. @@ -19488,6 +19491,9 @@ keys: bfd: type: bool description: Enable/Disable BFD. + make_before_break: + type: bool + description: Enable/Disable Make-Before-Break. rp_addresses: type: list items: diff --git a/python-avd/pyavd/_eos_cli_config_gen/schema/schema_fragments/router_pim_sparse_mode.schema.yml b/python-avd/pyavd/_eos_cli_config_gen/schema/schema_fragments/router_pim_sparse_mode.schema.yml index c10d5bf0a87..52d7ba41ecd 100644 --- a/python-avd/pyavd/_eos_cli_config_gen/schema/schema_fragments/router_pim_sparse_mode.schema.yml +++ b/python-avd/pyavd/_eos_cli_config_gen/schema/schema_fragments/router_pim_sparse_mode.schema.yml @@ -15,6 +15,9 @@ keys: bfd: type: bool description: Enable/Disable BFD. + make_before_break: + type: bool + description: Enable/Disable Make-Before-Break. ssm_range: type: str description: IPv4 Prefix associated with SSM. @@ -85,6 +88,9 @@ keys: bfd: type: bool description: Enable/Disable BFD. + make_before_break: + type: bool + description: Enable/Disable Make-Before-Break. rp_addresses: type: list items: From 1b8e15ee97b4a3663c33f731612c918b82bdcea3 Mon Sep 17 00:00:00 2001 From: dhayes Date: Thu, 21 Nov 2024 11:38:39 +1100 Subject: [PATCH 02/11] fixing jinja in make-before-break doc --- .../j2templates/documentation/router-pim-sparse-mode.j2 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/python-avd/pyavd/_eos_cli_config_gen/j2templates/documentation/router-pim-sparse-mode.j2 b/python-avd/pyavd/_eos_cli_config_gen/j2templates/documentation/router-pim-sparse-mode.j2 index 179d128ec3e..4b2f704687f 100644 --- a/python-avd/pyavd/_eos_cli_config_gen/j2templates/documentation/router-pim-sparse-mode.j2 +++ b/python-avd/pyavd/_eos_cli_config_gen/j2templates/documentation/router-pim-sparse-mode.j2 @@ -12,9 +12,11 @@ {% if router_pim_sparse_mode.ipv4 is arista.avd.defined %} BFD enabled: {{ router_pim_sparse_mode.ipv4.bfd | arista.avd.default(false) }} -{% if router_pim_sparse_mode.ipv4.rp_addresses is arista.avd.defined %} +{% if router_pim_sparse_mode.ipv4.make_before_break is arista.avd.defined %} Make-before-break: {{ router_pim_sparse_mode.ipv4.make_before_break }} +{% endif %} +{% if router_pim_sparse_mode.ipv4.rp_addresses is arista.avd.defined %} ##### IP Rendezvous Information From 79f537b156f853518ab0041356a12e440355459c Mon Sep 17 00:00:00 2001 From: dhayes Date: Thu, 21 Nov 2024 21:07:05 +1100 Subject: [PATCH 03/11] adding test coverage for make_before_break: true --- .../molecule/eos_cli_config_gen/documentation/devices/host1.md | 1 + .../avd/molecule/eos_cli_config_gen/intended/configs/host1.cfg | 1 + .../inventory/host_vars/host1/router-pim-sparse-mode.yml | 1 + 3 files changed, 3 insertions(+) diff --git a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/host1.md b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/host1.md index 06c74d57f46..8031a3a5970 100644 --- a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/host1.md +++ b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/host1.md @@ -5919,6 +5919,7 @@ router pim sparse-mode ! vrf Test_RP_ACL ipv4 + make-before-break rp address 10.238.4.161 access-list RP_ACL rp address 10.238.4.161 access-list RP_ACL2 priority 20 hashmask 30 override ``` diff --git a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/intended/configs/host1.cfg b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/intended/configs/host1.cfg index e26d053fe5f..0012bc6af82 100644 --- a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/intended/configs/host1.cfg +++ b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/intended/configs/host1.cfg @@ -3804,6 +3804,7 @@ router pim sparse-mode ! vrf Test_RP_ACL ipv4 + make-before-break rp address 10.238.4.161 access-list RP_ACL rp address 10.238.4.161 access-list RP_ACL2 priority 20 hashmask 30 override ! diff --git a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/host1/router-pim-sparse-mode.yml b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/host1/router-pim-sparse-mode.yml index 501d6844df7..266cca1795b 100644 --- a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/host1/router-pim-sparse-mode.yml +++ b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/host1/router-pim-sparse-mode.yml @@ -47,6 +47,7 @@ router_pim_sparse_mode: hashmask: 30 - name: Test_RP_ACL ipv4: + make_before_break: true rp_addresses: - address: 10.238.4.161 access_lists: From 8f6d85ef09f7dafb8aa1e725c16db189d5f8e5c0 Mon Sep 17 00:00:00 2001 From: dhayes Date: Fri, 22 Nov 2024 10:07:46 +1100 Subject: [PATCH 04/11] removing colons from j2templates --- .../j2templates/eos/router-pim-sparse-mode.j2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/router-pim-sparse-mode.j2 b/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/router-pim-sparse-mode.j2 index 4b0462dfcf6..7bb8abbb289 100644 --- a/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/router-pim-sparse-mode.j2 +++ b/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/router-pim-sparse-mode.j2 @@ -16,7 +16,7 @@ router pim sparse-mode bfd {% endif %} {% if router_pim_sparse_mode.ipv4.make_before_break is arista.avd.defined %} -{% if router_pim_sparse_mode.ipv4.make_before_break: %} +{% if router_pim_sparse_mode.ipv4.make_before_break %} make-before-break {% else %} make-before-break disabled @@ -67,7 +67,7 @@ router pim sparse-mode bfd {% endif %} {% if vrf.ipv4.make_before_break is arista.avd.defined %} -{% if vrf.ipv4.make_before_break: %} +{% if vrf.ipv4.make_before_break %} make-before-break {% else %} make-before-break disabled From be03e85c80fa1beea8b31ca32ec21566a90ac83f Mon Sep 17 00:00:00 2001 From: Guillaume Mulocher Date: Fri, 22 Nov 2024 11:29:08 +0100 Subject: [PATCH 05/11] Apply suggestions from code review --- .../j2templates/eos/router-pim-sparse-mode.j2 | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/router-pim-sparse-mode.j2 b/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/router-pim-sparse-mode.j2 index 7bb8abbb289..0c780f70eae 100644 --- a/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/router-pim-sparse-mode.j2 +++ b/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/router-pim-sparse-mode.j2 @@ -15,12 +15,10 @@ router pim sparse-mode {% if router_pim_sparse_mode.ipv4.bfd is arista.avd.defined(true) %} bfd {% endif %} -{% if router_pim_sparse_mode.ipv4.make_before_break is arista.avd.defined %} -{% if router_pim_sparse_mode.ipv4.make_before_break %} +{% if vrf.ipv4.make_before_break is arista.avd.defined(true) %} make-before-break -{% else %} +{% elif vrf.ipv4.make_before_break is arista.avd.defined(false) %} make-before-break disabled -{% endif %} {% endif %} {% for rp_address in router_pim_sparse_mode.ipv4.rp_addresses | arista.avd.natural_sort('address') %} {% set rp_options_cli = "" %} @@ -66,12 +64,10 @@ router pim sparse-mode {% if vrf.ipv4.bfd is arista.avd.defined(true) %} bfd {% endif %} -{% if vrf.ipv4.make_before_break is arista.avd.defined %} -{% if vrf.ipv4.make_before_break %} +{% if vrf.ipv4.make_before_break is arista.avd.defined(true) %} make-before-break -{% else %} +{% elif vrf.ipv4.make_before_break is arista.avd.defined(false) %} make-before-break disabled -{% endif %} {% endif %} {% for rp_address in vrf.ipv4.rp_addresses | arista.avd.natural_sort('address') %} {% set rp_options_cli = "" %} From f8565f953af85a20545944a545efa0322d78aeaa Mon Sep 17 00:00:00 2001 From: gmuloc Date: Fri, 22 Nov 2024 11:32:57 +0100 Subject: [PATCH 06/11] Revert "Apply suggestions from code review" This reverts commit be03e85c80fa1beea8b31ca32ec21566a90ac83f. --- .../j2templates/eos/router-pim-sparse-mode.j2 | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/router-pim-sparse-mode.j2 b/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/router-pim-sparse-mode.j2 index 0c780f70eae..7bb8abbb289 100644 --- a/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/router-pim-sparse-mode.j2 +++ b/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/router-pim-sparse-mode.j2 @@ -15,10 +15,12 @@ router pim sparse-mode {% if router_pim_sparse_mode.ipv4.bfd is arista.avd.defined(true) %} bfd {% endif %} -{% if vrf.ipv4.make_before_break is arista.avd.defined(true) %} +{% if router_pim_sparse_mode.ipv4.make_before_break is arista.avd.defined %} +{% if router_pim_sparse_mode.ipv4.make_before_break %} make-before-break -{% elif vrf.ipv4.make_before_break is arista.avd.defined(false) %} +{% else %} make-before-break disabled +{% endif %} {% endif %} {% for rp_address in router_pim_sparse_mode.ipv4.rp_addresses | arista.avd.natural_sort('address') %} {% set rp_options_cli = "" %} @@ -64,10 +66,12 @@ router pim sparse-mode {% if vrf.ipv4.bfd is arista.avd.defined(true) %} bfd {% endif %} -{% if vrf.ipv4.make_before_break is arista.avd.defined(true) %} +{% if vrf.ipv4.make_before_break is arista.avd.defined %} +{% if vrf.ipv4.make_before_break %} make-before-break -{% elif vrf.ipv4.make_before_break is arista.avd.defined(false) %} +{% else %} make-before-break disabled +{% endif %} {% endif %} {% for rp_address in vrf.ipv4.rp_addresses | arista.avd.natural_sort('address') %} {% set rp_options_cli = "" %} From 024e33d87180b0225be1ad72bb8cdbd522fa95c3 Mon Sep 17 00:00:00 2001 From: gmuloc Date: Fri, 22 Nov 2024 12:59:06 +0100 Subject: [PATCH 07/11] Refactor: Address PR comment --- .../documentation/devices/host1.md | 17 +++------- .../documentation/devices/host2.md | 30 +++++++++++++++++ .../intended/configs/host2.cfg | 8 +++++ .../host2/router-pim-sparse-mode.yml | 9 ++++++ .../documentation/router-pim-sparse-mode.j2 | 32 +++++++++++-------- 5 files changed, 70 insertions(+), 26 deletions(-) create mode 100644 ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/host2/router-pim-sparse-mode.yml diff --git a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/host1.md b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/host1.md index 9bff0fddaef..7c066fcb70d 100644 --- a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/host1.md +++ b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/host1.md @@ -7594,18 +7594,11 @@ Make-before-break: False ##### IP Sparse Mode VRFs -| VRF Name | BFD Enabled | -| -------- | ----------- | -| MCAST_VRF1 | True | -| MCAST_VRF2_ALL_GROUPS | False | -| Test_RP_ACL | False | - -| VRF Name | Rendezvous Point Address | Group Address | Access Lists | Priority | Hashmask | Override | -| -------- | ------------------------ | ------------- | ------------ | -------- | -------- | -------- | -| MCAST_VRF1 | 10.238.2.161 | 239.12.22.12/32, 239.12.22.13/32, 239.12.22.14/32 | - | - | - | - | -| MCAST_VRF2_ALL_GROUPS | 10.238.3.161 | - | - | - | 30 | - | -| Test_RP_ACL | 10.238.4.161 | - | RP_ACL | - | - | - | -| Test_RP_ACL | 10.238.4.161 | - | RP_ACL2 | 20 | 30 | True | +| VRF Name | BFD Enabled | Make Before Break | +| -------- | ----------- | ----------------- | +| MCAST_VRF1 | True | False | +| MCAST_VRF2_ALL_GROUPS | False | - | +| Test_RP_ACL | False | True | ##### Router Multicast Device Configuration diff --git a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/host2.md b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/host2.md index 0b31ca740c5..551fbb37a6c 100644 --- a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/host2.md +++ b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/host2.md @@ -48,6 +48,7 @@ - [Queue Monitor Configuration](#queue-monitor-configuration) - [Multicast](#multicast) - [IP IGMP Snooping](#ip-igmp-snooping) + - [PIM Sparse Mode](#pim-sparse-mode) - [Filters](#filters) - [AS Path Lists](#as-path-lists) - [802.1X Port Security](#8021x-port-security) @@ -683,6 +684,35 @@ no ip igmp snooping vlan 30 no ip igmp snooping querier ``` +### PIM Sparse Mode + +#### Router PIM Sparse Mode + +##### IP Sparse Mode Information + +BFD enabled: False + +Make-before-break: True + +##### IP Sparse Mode VRFs + +| VRF Name | BFD Enabled | Make Before Break | +| -------- | ----------- | ----------------- | +| MCAST_VRF1 | False | True | + +##### Router Multicast Device Configuration + +```eos +! +router pim sparse-mode + ipv4 + make-before-break + ! + vrf MCAST_VRF1 + ipv4 + make-before-break +``` + ## Filters ### AS Path Lists diff --git a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/intended/configs/host2.cfg b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/intended/configs/host2.cfg index 7bb341318ff..ef9e0974758 100644 --- a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/intended/configs/host2.cfg +++ b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/intended/configs/host2.cfg @@ -189,6 +189,14 @@ router bgp 65101 address-family path-selection no bgp additional-paths send ! +router pim sparse-mode + ipv4 + make-before-break + ! + vrf MCAST_VRF1 + ipv4 + make-before-break +! dot1x system-auth-control dot1x protocol lldp bypass dot1x protocol bpdu bypass diff --git a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/host2/router-pim-sparse-mode.yml b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/host2/router-pim-sparse-mode.yml new file mode 100644 index 00000000000..4dab3fb9320 --- /dev/null +++ b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/host2/router-pim-sparse-mode.yml @@ -0,0 +1,9 @@ +--- +#### Router pim sparse mode #### +router_pim_sparse_mode: + ipv4: + make_before_break: true + vrfs: + - name: MCAST_VRF1 + ipv4: + make_before_break: true diff --git a/python-avd/pyavd/_eos_cli_config_gen/j2templates/documentation/router-pim-sparse-mode.j2 b/python-avd/pyavd/_eos_cli_config_gen/j2templates/documentation/router-pim-sparse-mode.j2 index 4b2f704687f..fa03d271117 100644 --- a/python-avd/pyavd/_eos_cli_config_gen/j2templates/documentation/router-pim-sparse-mode.j2 +++ b/python-avd/pyavd/_eos_cli_config_gen/j2templates/documentation/router-pim-sparse-mode.j2 @@ -49,26 +49,30 @@ Make-before-break: {{ router_pim_sparse_mode.ipv4.make_before_break }} ##### IP Sparse Mode VRFs -| VRF Name | BFD Enabled | -| -------- | ----------- | +{% set any_ipv4_ip_addresses = False %} +| VRF Name | BFD Enabled | Make Before Break | +| -------- | ----------- | ----------------- | {% for vrf in router_pim_sparse_mode.vrfs | arista.avd.natural_sort('name') %} -| {{ vrf.name }} | {{ vrf.ipv4.bfd | arista.avd.default(false) }} | +{% set any_ipv4_ip_addresses = any_ipv4_ip_addresses or (vrf.ipv4.rp_addresses is arista.avd.defined and (vrf.ipv4.rp_addresses | length) > 0) %} +| {{ vrf.name }} | {{ vrf.ipv4.bfd | arista.avd.default(false) }} | {{ vrf.ipv4.make_before_break | default("-") }} | {% endfor %} +{% if any_ipv4_ip_addresses %} | VRF Name | Rendezvous Point Address | Group Address | Access Lists | Priority | Hashmask | Override | | -------- | ------------------------ | ------------- | ------------ | -------- | -------- | -------- | -{% for vrf in router_pim_sparse_mode.vrfs | arista.avd.natural_sort('name') %} -{% if vrf.ipv4.rp_addresses is arista.avd.defined %} -{% for rp_address in vrf.ipv4.rp_addresses | arista.avd.natural_sort('address') %} -{% set rp_groups = rp_address.groups | arista.avd.default(['-']) | join(', ') %} -{% set access_lists = rp_address.access_lists | arista.avd.default(['-']) | join(', ') %} -{% set priority = rp_address.priority | arista.avd.default('-') %} -{% set hashmask = rp_address.hashmask | arista.avd.default('-') %} -{% set override = rp_address.override | arista.avd.default('-') %} +{% for vrf in router_pim_sparse_mode.vrfs | arista.avd.natural_sort('name') %} +{% if vrf.ipv4.rp_addresses is arista.avd.defined %} +{% for rp_address in vrf.ipv4.rp_addresses | arista.avd.natural_sort('address') %} +{% set rp_groups = rp_address.groups | arista.avd.default(['-']) | join(', ') %} +{% set access_lists = rp_address.access_lists | arista.avd.default(['-']) | join(', ') %} +{% set priority = rp_address.priority | arista.avd.default('-') %} +{% set hashmask = rp_address.hashmask | arista.avd.default('-') %} +{% set override = rp_address.override | arista.avd.default('-') %} | {{ vrf.name }} | {{ rp_address.address }} | {{ rp_groups }} | {{ access_lists }} | {{ priority }} | {{ hashmask }} | {{ override }} | -{% endfor %} -{% endif %} -{% endfor %} +{% endfor %} +{% endif %} +{% endfor %} +{% endif %} {% endif %} ##### Router Multicast Device Configuration From 85312a612b7b4c637d371dcfbeebe678a390a32f Mon Sep 17 00:00:00 2001 From: gmuloc Date: Fri, 22 Nov 2024 13:09:29 +0100 Subject: [PATCH 08/11] Refactor: Use namespace --- .../eos_cli_config_gen/documentation/devices/host1.md | 7 +++++++ .../j2templates/documentation/router-pim-sparse-mode.j2 | 6 +++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/host1.md b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/host1.md index 7c066fcb70d..1adc9440486 100644 --- a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/host1.md +++ b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/host1.md @@ -7600,6 +7600,13 @@ Make-before-break: False | MCAST_VRF2_ALL_GROUPS | False | - | | Test_RP_ACL | False | True | +| VRF Name | Rendezvous Point Address | Group Address | Access Lists | Priority | Hashmask | Override | +| -------- | ------------------------ | ------------- | ------------ | -------- | -------- | -------- | +| MCAST_VRF1 | 10.238.2.161 | 239.12.22.12/32, 239.12.22.13/32, 239.12.22.14/32 | - | - | - | - | +| MCAST_VRF2_ALL_GROUPS | 10.238.3.161 | - | - | - | 30 | - | +| Test_RP_ACL | 10.238.4.161 | - | RP_ACL | - | - | - | +| Test_RP_ACL | 10.238.4.161 | - | RP_ACL2 | 20 | 30 | True | + ##### Router Multicast Device Configuration ```eos diff --git a/python-avd/pyavd/_eos_cli_config_gen/j2templates/documentation/router-pim-sparse-mode.j2 b/python-avd/pyavd/_eos_cli_config_gen/j2templates/documentation/router-pim-sparse-mode.j2 index fa03d271117..942f49758ac 100644 --- a/python-avd/pyavd/_eos_cli_config_gen/j2templates/documentation/router-pim-sparse-mode.j2 +++ b/python-avd/pyavd/_eos_cli_config_gen/j2templates/documentation/router-pim-sparse-mode.j2 @@ -49,14 +49,14 @@ Make-before-break: {{ router_pim_sparse_mode.ipv4.make_before_break }} ##### IP Sparse Mode VRFs -{% set any_ipv4_ip_addresses = False %} +{% set any_ipv4_ip_addresses = namespace(present=false) %} | VRF Name | BFD Enabled | Make Before Break | | -------- | ----------- | ----------------- | {% for vrf in router_pim_sparse_mode.vrfs | arista.avd.natural_sort('name') %} -{% set any_ipv4_ip_addresses = any_ipv4_ip_addresses or (vrf.ipv4.rp_addresses is arista.avd.defined and (vrf.ipv4.rp_addresses | length) > 0) %} +{% set any_ipv4_ip_addresses.present = any_ipv4_ip_addresses.present or (vrf.ipv4.rp_addresses is arista.avd.defined and (vrf.ipv4.rp_addresses | length) > 0) %} | {{ vrf.name }} | {{ vrf.ipv4.bfd | arista.avd.default(false) }} | {{ vrf.ipv4.make_before_break | default("-") }} | {% endfor %} -{% if any_ipv4_ip_addresses %} +{% if any_ipv4_ip_addresses.present %} | VRF Name | Rendezvous Point Address | Group Address | Access Lists | Priority | Hashmask | Override | | -------- | ------------------------ | ------------- | ------------ | -------- | -------- | -------- | From 9a63590494ec6c155cfe6efdfad2e99730fecab0 Mon Sep 17 00:00:00 2001 From: Claus Holbech Date: Fri, 22 Nov 2024 14:56:45 +0100 Subject: [PATCH 09/11] Update python-avd/pyavd/_eos_cli_config_gen/j2templates/documentation/router-pim-sparse-mode.j2 --- .../j2templates/documentation/router-pim-sparse-mode.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python-avd/pyavd/_eos_cli_config_gen/j2templates/documentation/router-pim-sparse-mode.j2 b/python-avd/pyavd/_eos_cli_config_gen/j2templates/documentation/router-pim-sparse-mode.j2 index 942f49758ac..5c716d0f67f 100644 --- a/python-avd/pyavd/_eos_cli_config_gen/j2templates/documentation/router-pim-sparse-mode.j2 +++ b/python-avd/pyavd/_eos_cli_config_gen/j2templates/documentation/router-pim-sparse-mode.j2 @@ -50,7 +50,7 @@ Make-before-break: {{ router_pim_sparse_mode.ipv4.make_before_break }} ##### IP Sparse Mode VRFs {% set any_ipv4_ip_addresses = namespace(present=false) %} -| VRF Name | BFD Enabled | Make Before Break | +| VRF Name | BFD Enabled | Make-before-break | | -------- | ----------- | ----------------- | {% for vrf in router_pim_sparse_mode.vrfs | arista.avd.natural_sort('name') %} {% set any_ipv4_ip_addresses.present = any_ipv4_ip_addresses.present or (vrf.ipv4.rp_addresses is arista.avd.defined and (vrf.ipv4.rp_addresses | length) > 0) %} From 8a86546726617716b484ccac739c8f16c42efe9b Mon Sep 17 00:00:00 2001 From: Claus Holbech Date: Fri, 22 Nov 2024 17:39:21 +0100 Subject: [PATCH 10/11] Update ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/host1.md --- .../molecule/eos_cli_config_gen/documentation/devices/host1.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/host1.md b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/host1.md index 1adc9440486..402324f1856 100644 --- a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/host1.md +++ b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/host1.md @@ -7594,7 +7594,7 @@ Make-before-break: False ##### IP Sparse Mode VRFs -| VRF Name | BFD Enabled | Make Before Break | +| VRF Name | BFD Enabled | Make-before-break | | -------- | ----------- | ----------------- | | MCAST_VRF1 | True | False | | MCAST_VRF2_ALL_GROUPS | False | - | From 97e91848c201d8886895d6ea5ab2c8591b8cdd31 Mon Sep 17 00:00:00 2001 From: Claus Holbech Date: Fri, 22 Nov 2024 17:39:42 +0100 Subject: [PATCH 11/11] Update ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/host2.md --- .../molecule/eos_cli_config_gen/documentation/devices/host2.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/host2.md b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/host2.md index 551fbb37a6c..3ed6124da2e 100644 --- a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/host2.md +++ b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/host2.md @@ -696,7 +696,7 @@ Make-before-break: True ##### IP Sparse Mode VRFs -| VRF Name | BFD Enabled | Make Before Break | +| VRF Name | BFD Enabled | Make-before-break | | -------- | ----------- | ----------------- | | MCAST_VRF1 | False | True |