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

ios_route_maps doesn't parse full configuration files #884

Open
nleiva opened this issue Jul 12, 2023 · 0 comments
Open

ios_route_maps doesn't parse full configuration files #884

nleiva opened this issue Jul 12, 2023 · 0 comments
Assignees
Labels
bug This issue/PR relates to a bug. route_maps route_maps resource module

Comments

@nleiva
Copy link

nleiva commented Jul 12, 2023

SUMMARY

ios_route_maps can only parse a Cisco IOS config that starts with route-map, probably from the sh running-config | section ^route-map command.

Other Cisco IOS resource modules (most of them) can take a full config as input, i.e. the output of sh running-config and parse the resource-module specific section.

ISSUE TYPE
  • Bug Report
COMPONENT NAME

cisco.ios.ios_route_maps

ANSIBLE VERSION
2.15
COLLECTION VERSION
cisco.ios
CONFIGURATION
N/A
OS / ENVIRONMENT

Any version of Cisco IOS or IOS-XE

STEPS TO REPRODUCE
- name: Parse route maps for provided configuration
  cisco.ios.ios_route_maps:
    running_config: "{{ lookup('file', 'route-map.cfg') }}"
    state: parsed
  register: ios_route_maps

Where route-map.cfg is:

interface Port-channel1.105
 description BC_AM11_ECX_CUSTOMERABCD_LD7
 encapsulation dot1Q 105
 ip vrf forwarding customerabcd-vrf
 ip address 100.64.136.90 255.255.255.252
 ip nat inside
 bfd interval 750 min_rx 750 multiplier 3
!
route-map RM-ROUTES-TO-PA-CUSTOMERABCD-VRF permit 10
 match metric 10
 set as-path prepend 65000
 !
route-map RM-ROUTES-TO-PA-CUSTOMERABCD-VRF permit 20
 match ip address prefix-list max24 
 set ip next hop 10.2.2.2 
!
route-map RM-ROUTES-TO-PA-CUSTOMERABCD-VRF permit 30
 set as-path prepend 65000 65000 65000
 continue
 !
route-map RM-ROUTES-TO-PA-CUSTOMERABCD-VRF permit 40
 match community 10:1
 set local-preference 104
!
EXPECTED RESULTS

I'd like to be able to parse a full config with this module.

ACTUAL RESULTS
fatal: [localhost]: FAILED! => {"changed": false, "msg": "'route_map' is undefined"}
@KB-perByte KB-perByte added bug This issue/PR relates to a bug. route_maps route_maps resource module labels Jul 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue/PR relates to a bug. route_maps route_maps resource module
Projects
None yet
Development

No branches or pull requests

2 participants