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

Idempotent command handling enhancements #61

Open
3 tasks
aedwardstx opened this issue Jun 19, 2018 · 2 comments
Open
3 tasks

Idempotent command handling enhancements #61

aedwardstx opened this issue Jun 19, 2018 · 2 comments
Labels
enhancement New feature or request

Comments

@aedwardstx
Copy link
Collaborator

  • Find a way to use a single idempotency rule for the following:
client 10.1.1.1 server-key
client 10.2.2.2 server-key 
#e.g.
idempotent_commands:
- lineage:
  - re_search: ^client {client_ip} server-key 
  • See what we can do to clarify this or improve HConfig behavior
    For the best results, idempotent command lineage rules should be a single match per rule e.g.
idempotent_commands:
- lineage:
  - startswith: hardware access-list tcam region
- lineage:
  - startswith: hardware profile tcam region

If you were to lump them together, an idempotent command check for hardware profile tcam region X would be True if hardware access-list tcam region Y were in the compiled_config. Much of the time, this is still okay but there are cases where it is not. In certain cases, this behavior can shadow command negations.

  • Restructure Idempotent rules to not require the word lineage over and over
idempotent_commands:
- - startswith: aaa authentication attempts
- - startswith: aaa authentication login
- - startswith: aaa authentication enable
- - startswith: interface # Support for deep rules
  - startswith: description
@aedwardstx aedwardstx added the enhancement New feature or request label Jun 19, 2018
@edurguti
Copy link

doesn't CiscoConfParse do this?

@kulpatel
Copy link

kulpatel commented Sep 22, 2023

One Question here
Assume my

idempotent_commands:

  • lineage:
    - startswith: router bgp
    - re_search: ^neighbor .+ remote-as .+$

i.e
Running config

router bgp 1001
neighbor 40.0.0.0 remote-as 33001
neighbor 40.0.0.17 remote-as 1002
neighbor 40.0.0.8 remote-as 2002

New Expected Config

router bgp 1001
neighbor 40.0.0.0 remote-as 44001
neighbor 1000:: remote-as 2001
neighbor 1000::8 remote-as 2002

With above idempotent rule- it generates below remidial config

router bgp 1001
neighbor 40.0.0.0 remote-as 44001
neighbor 1000:: remote-as 2001
neighbor 1000::8 remote-as 2002

and doesnt not negate .17 and .8 neighbour

My expected remedial config: (replace where neighbour ip matches, and only ASN is idempotent. And do negation and add which ever is neessary)

router bgp 1001
neighbor 40.0.0.0 remote-as 44001
neighbor 1000:: remote-as 2001
neighbor 1000::8 remote-as 2002
no neighbor 40.0.0.17 remote-as 1002
no neighbor 40.0.0.8 remote-as 2002

How can i achieve this behaviour? can you suggest the example of idempotent rule here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants