Sunday, June 20, 2021

Cisco's new two-stage configuration commit feature in NX-OS 10 appears to work well, but anyone get it working with Ansible?

Hello /r/networking internet strangers,

I spent a good chunk of the weekend tinkering with the new two-stage configuration commit feature Cisco snuck into NX-OS 10.1.2. It works pretty close to the JunOS "commit confirmed" functionality I know and love, so that's been quite nice on the CLI.

But what I really want to do is use this new feature with the cisco.nxos collection in Ansible. Unfortunately it doesn't look like Cisco has updated Ansible Galaxy to support two-stage configuration commit yet, and given their verbiage of "This feature is supported only for a CLI interface in a user-interactive session." in the guidelines/limitations section, I'm not sure if they ever will.

I tried using cisco.nxos.nxos_command in Ansible to trick my playbook into applying two-stage configuration commit changes. But I don't think this is possible since the SSH connection gracefully disconnects after the cisco.nxos.nxos_command task wraps up, and NX-OS appears to just go ahead and confirm the config immediately upon graceful disconnect.

So unless someone goes through the pain/suffering of writing a custom module, I don't think I can work around this limitation in Ansible? Or maybe I got it wrong and there's something else going on under the hood. Either way, super curious if anyone else out there has kicked the tires on this NX-OS two-stage configuration commit feature with a network automation tool.

If you're still reading this and want to see what I was trying in the playbooks, everything is up at https://github.com/kd9cpb/homelab/tree/main/lab11. Also I wrote up everything I did in the homelab regarding two-stage configuration commit at https://kd9cpb.com/nxos-commit-confirm if anyone still cares to hear me blab on about it. Since Ansible wasn't working out, I decided to try getting Netmiko to behave with NX-OS two-stage configuration commit, and that worked out quite nicely. I'd absolutely love to do "commit confirmed" from Ansible onto NX-OS just as easily as you can with JunOS though.

Usually I stick to more vendor-specific subreddits, but considering my predicament involves a somewhat interesting feature with multiple vendor thingies, figured here is the best home for this matter. Best case scenario maybe more people hop on the "commit confirmed" bandwaggon after seeing it's now in NX-OS, and someone comments about getting it to work in Ansible. Worst case scenario, I become the laughingstock of the subreddit due to my terrible network automation code, and that's totally cool too :)



No comments:

Post a Comment