05-08-2023 04:31 PM - last edited on 05-08-2023 06:47 PM by rupeshah
Hi DevNet Folks,
Following my NXOS upgrade playbook I shared last time; I have now created a playbook for IOSXE which has been tested against Cat9K and Cat8500. Thanks to Suresh Vina for testing against Cat9K.
I have used the following to build this playbook, which help some individuals to understand, how you can utilise these items in Ansible.
- Ansible with PyATS Role.
- Regex to find strings.
- IOSXE Ansible Facts Module.
- Ansible Block Rescue and Always.
What does this playbook cover?
- Display current facts about the device in question.
- Config Backup before starting the upgrade.
- Assert that device is not running with the expected IOXE Version.
- Assert that device has enough disk space to accommodate new image.
- Assert that device disk has the new image.
- Copy the image via SCP or FTP.
- Verify the new image with given MD5 Hash.
- Install/upgrade the IOSXE software upgrade with the new image.
- Clean up old or unnecessary packages.
What does this playbook do not cover? So, you may need to create separate playbooks for that.
- Any L2/L3 checks before or after the upgrade.
Here is the link for the repo. I am open with any suggestions.
https://github.com/muhammad-rafi/Ansible-Projects/blob/main/iosxe_ansible_project/playbooks/iosxe_upgrade.yml
Please also see the attached screenshots for this playbook run.
05-09-2023 12:18 AM
Thanks @murafi for sharing.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide