Idempotent command handling enhancements
- [ ] 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
lineageover and over
idempotent_commands:
- - startswith: aaa authentication attempts
- - startswith: aaa authentication login
- - startswith: aaa authentication enable
- - startswith: interface # Support for deep rules
- startswith: description
doesn't CiscoConfParse do this?
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.