cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1714
Views
2
Helpful
5
Replies

NXOS 9K upgrade with Ansible

murafi
Cisco Employee
Cisco Employee

Hi DevNet folks,

 

I recently upgraded some of the Nexus 9K series switches and decided to automate the process since they were newly deployed. However, if you have a pair of production switches, you can still use this playbook with the proper precautions. Please ensure that you either create a playbook or conduct manual checks to perform pre and post checks to guarantee Layer2/3 functionality as well as VPCs.

 

By going through this playbook, you will learn the following:

 

  • nxos command utilities such as json-pretty, grep, and awk
  • Backup nxos config and command modules.
  • Ansible assert module.
  • Ansible Block Rescue/Always module.
  • Ansible pause module.
  • Ansible wait_for module.
  • Ansible tags, vars, var_prompts, and set_facts

 

Please give it a try this on any lab N9K switch and let me know how it works for you. Reach out to me, if you encounter any issues. You can find the playbook on Github using the following link.

https://github.com/muhammad-rafi/Ansible-Projects/blob/main/nxos_ansible_project/playbooks/n9k_upgrade.yml

 

 

5 Replies 5

Good stuff buddy, great to see you are still making and sharing awesome code! Hope you are keeping well my friend.

Please mark this as helpful or solution accepted to help others
Connect with me https://bigevilbeard.github.io

thanks buddy, just following your footsteps  

wienlam
Level 1
Level 1

when running your playbook on multiple devices only one device is checked after reload and playbook produces error for all the other devices even though they are reachable, should there be a loop function somewhere to keep checking

can you please share the output and as well as the playbook ? 

playbook and output attached, I only used the reload section of your 9K playbook