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

Route Map - Wrong order of operations when inserting seq and changing action at the same time #960

Open
bl1nkbl1nk opened this issue Nov 6, 2023 · 0 comments
Assignees
Labels
bug This issue/PR relates to a bug. route_maps route_maps resource module

Comments

@bl1nkbl1nk
Copy link

SUMMARY

This issue seems to occur when we have a sequence number that gets inserted but at the same time changes action. For example:

Route map before:
seq 10 deny
seq 20 deny
seq 30 permit

Route map after:
seq 10 deny
seq 20 deny
seq 30 deny
now last item goes from 30 to 40 like so: seq 40 permit

The commands fired to the box are now like this:

commands:

  • route-map x deny 30
  • match rpki invalid
  • no match community stuff
  • route-map x deny 40
  • match community stuff
  • route-map x permit 50
  • match ip address prefix-list pl_all
  • match as-path 102
  • set local-preference 200
  • no route-map x permit 40

Note that the deletion of the statement happens at the end where as it should be fired first.

ISSUE TYPE
  • Bug Report
COMPONENT NAME

ios_route_maps

ANSIBLE VERSION
 ansible --version 
ansible [core 2.15.4]
  config file = /Users/x/Documents/workspace/ansible-prod/ansible.cfg
  configured module search path = ['/Users/x/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python3.11/site-packages/ansible
  ansible collection location = /Users/x/ansible/collections:/usr/share/ansible/collections
  executable location = /usr/local/bin/ansible
  python version = 3.11.6 (main, Oct  3 2023, 02:51:45) [Clang 14.0.3 (clang-1403.0.22.14.1)] (/usr/local/opt/python@3.11/bin/python3.11)
  jinja version = 3.1.2
  libyaml = True
COLLECTION VERSION
cisco.ios                     4.6.1
CONFIGURATION
no relevant changes
OS / ENVIRONMENT

asr1000-universalk9.16.09.05.SPA.bin

STEPS TO REPRODUCE

have described the issue in summary.

- name: Configure Route Maps 
  cisco.ios.ios_route_maps:
    config: "{{ lookup('ansible.builtin.template', 'templates/ios-route-maps.j2') }}"
    state: replaced

j2: insert YAML from facts
EXPECTED RESULTS

Different order of operations. The Deny to Permit change in a seq number will cause an outage (all bad prefixes being allowed)

ACTUAL RESULTS

see in summary: these commands run on the box

  commands:
  - route-map x deny 30
  - match rpki invalid
  - no match community stuff
  - route-map x deny 40
  - match community stuff
  - route-map x permit 50
  - match ip address prefix-list pl_all
  - match as-path 102
  - set local-preference 200
  - no route-map x permit 40

@NilashishC NilashishC added route_maps route_maps resource module bug This issue/PR relates to a bug. labels Nov 8, 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

3 participants