Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

eos_bgp_global cannot specify "in" and "out" route-maps for neighbor #538

Open
yheffen opened this issue May 6, 2024 · 2 comments
Open
Assignees
Labels
needs_info This issue requires further information. Please answer any outstanding questions.

Comments

@yheffen
Copy link

yheffen commented May 6, 2024

SUMMARY

It is not unusual to specify both incoming and outgoing route-maps to a BGP neighbor,

router bgp 65000
local-as 65000
router-id 192.0.2.1
neighbor 192.0.2.2 route-map MAP_INCOMING in
neighbor 192.0.2.2 route-map MAP_OUTGOING out

In the YAML for eos_bgp_global, there is only a single "route_map" dict per neighbor. It means you can have one or the other, but not both.

The cisco.ios.ios_bgp_global module handles this by instead having "route_maps" which is a list of dicts. Looks like they had "route_map" too, but have deprecated it.

ISSUE TYPE
  • Bug Report
COMPONENT NAME
ANSIBLE VERSION

COLLECTION VERSION

CONFIGURATION

OS / ENVIRONMENT
STEPS TO REPRODUCE
EXPECTED RESULTS
ACTUAL RESULTS

@roverflow
Copy link
Member

@yheffen Can you add a playbook as an example for the above

@roverflow roverflow added the needs_info This issue requires further information. Please answer any outstanding questions. label May 8, 2024
@yheffen
Copy link
Author

yheffen commented May 14, 2024

---

- name: Show route_map problem
  hosts: router.example.com

  tasks:
  - name: BGP Global
    arista.eos.eos_bgp_global:
      state: merged
      config:
        as_number: "4220000000"
        neighbor:
        - neighbor_address: "192.0.2.1"
          route_map:
            name: "MAP_INCOMING"
            direction: "in"
          route_map:
            name: "MAP_OUTGOING"
            direction: "out"

Adding a neighbor to an existing BGP configuration.

Output from the playbook run (notice the immediate warning),

$ ansible-playbook eos_bgp_global-route_map.yml 
[WARNING]: While constructing a mapping from /home/criclar/ansible/playbooks/eos_bgp_global-route_map.yml, line 13, column 11, found a duplicate dict key (route_map). Using last
defined value only.

PLAY [Show route_map problem] ***********************************************************************************************************************************************************

TASK [Gathering Facts] ******************************************************************************************************************************************************************
Monday 13 May 2024  16:58:08 -0700 (0:00:00.028)       0:00:00.028 ************ 
ok: [router.example.com]

TASK [BGP Global] ***********************************************************************************************************************************************************************
Monday 13 May 2024  16:58:12 -0700 (0:00:03.715)       0:00:03.744 ************ 
changed: [router.example.com]

PLAY RECAP ******************************************************************************************************************************************************************************
router.example.com    : ok=2    changed=1    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   

Monday 13 May 2024  16:58:17 -0700 (0:00:04.653)       0:00:08.397 ************ 
=============================================================================== 
BGP Global ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- 4.65s
Gathering Facts ------------------------------------------------------------------------------------------------------------------------------------------------------------------ 3.72s

Actual neighbor info added to router,

router#sh run | i neighbor 192.0.2.1
   neighbor 192.0.2.1 route-map MAP_OUTGOING out
router#

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs_info This issue requires further information. Please answer any outstanding questions.
Projects
None yet
Development

No branches or pull requests

3 participants