aristanetworks / avd

Arista Validated Designs
https://avd.arista.com
Apache License 2.0
299 stars 219 forks source link

eos_cli_config_gen / pim anycast rp config is not generated if 'other_anycast_rp_addresses' is not defined #4753

Open philippebureau opened 4 days ago

philippebureau commented 4 days ago

Issue Summary

example structured data:

      router_pim_sparse_mode:
        ipv4:
          anycast_rps:
            - address: 10.64.96.15

config output:

!
router pim sparse-mode
   ipv4
!

if you add ''other_anycast_rp_addresses' value it generate config

      router_pim_sparse_mode:
        ipv4:
          anycast_rps:
            - address: 10.64.96.15
              other_anycast_rp_addresses:
                - address: ""

output:

!
router pim sparse-mode
   ipv4
      anycast-rp 10.64.96.15 
!

the jinja template 'python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/router-pim-sparse-mode.j2'

i think the template should check if 'other_anycast_rp_addresses' exist before going into the for loop at line 45 and add elif with a for loop through anycast_rps.address

Screenshot from 2024-11-21 10-08-07

Which component(s) of AVD impacted

eos_cli_config_gen

How do you run AVD ?

Ansible CLI with AVD Runner

Steps to reproduce

No response

Relevant log output

No response

Contributing Guide

gmuloc commented 4 days ago

Can you please confirm which version of EOS you are using?

site2-wan2(config-s-gmuloc2-router-pim-sparse-ipv4)#anycast-rp ?
  A.B.C.D  anycast rendezvous point IP address

site2-wan2(config-s-gmuloc2-router-pim-sparse-ipv4)#anycast-rp 1.1.1.1 ?
  A.B.C.D  other anycast rendezvous point IP address

site2-wan2(config-s-gmuloc2-router-pim-sparse-ipv4)#anycast-rp 1.1.1.1
% Incomplete command
site2-wan2(config-s-gmuloc2-router-pim-sparse-ipv4)#anycast-rp 1.1.1.1 2.2.2.2 ?
  register-count  Number of registers to forward before pausing
  <cr>