netdevops / hier_config

Hierarchical Configuration
MIT License
126 stars 24 forks source link

Idempotent command handling enhancements #61

Open aedwardstx opened 6 years ago

aedwardstx commented 6 years ago
edurguti commented 3 years ago

doesn't CiscoConfParse do this?

kulpatel commented 1 year ago

One Question here Assume my

idempotent_commands:

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.