Scrapli_netconf is a winner ??
Muhammad Rafi
Sr. Network Engineer @Cisco | MSc | BS | CCIE Enterprise | DevNet Expert
I have just uploaded couple of netconf/restconf scripts for updating the NTP configuration for nxos using system yang data model.
I recently had a hard time to get my scripts/playbooks working for nxos version 7.0(x), I have tried the following but none of them worked for this version of nxos, however it works fine with 9.x versions
After spending couple of days and trying to automate via above tools with no luck whatsoever, I had a second thought to use scrapli_netconf as I used scrapli to automate traditional style network configuration changes but I never used it for Netconf and guess what, as soon as I wrote my first simple script to set the ntp desired state configuration for this version of nxos, apparently it worked straight away and it did really put the smile on my face, like this --> ??
I was so impressed and I really want to use scrapli_netconf moving forward, more likely with the Ansible, I may either have to write a module with scrapli or at least will raise it as feature enhancement with Ansible community to create one using scrapli_netconf, there is also an extension of scrapli_netconf for nornir framkework which works really well too.
I do not know the exact reason why all of above are not working for this version of nxos as I did not go deep to find out the cause of failure but I know one thing that they all are failing, because they all use ncclient library. I am not against ncclient library as it is very popular tool and works really great, however it failed for this nxos version and I will be raising an issue on github, I have already raised one for Ansible Netconf module though.
I like to thank @Carl Montanari for this awesome library and really keen to know what magic you did to make this work :) I also like to thank @John McGovern for his one of the videos for setting the EIGRP and NTP desired state configuration which inspired me to write these scripts.
Finally, I would like to mention few caveats I encountered whilst writing these basic scripts.
Here is the github link for the code, feel to free to try and let me know how they work for you.
Thanks,
- Rafi?
Network Automation Instructor
3 年Great job, Muhammad! Love me some Scrapli :)