r/ansible 6d ago

Automating Juniper Infrastructure

Hi all, I've recently been attempting to migrate my Juniper devices from being hand-managed to automated. I've been able to create and document the following resources. I hope they can help others, and I'm looking to add more in the future. Feedback would be much appreciated:

Junos-dev-playbook repository:

This repository contains a handful of Ansible playbooks and templates I use to automate my infrastructure. I currently have EX, NFX, QFX, and SRX devices in my homelab. I'm also working on adding more advanced playbooks/tasks to fully showcase how to automate properly with the juniper.device Ansible collection.

Containerizing vSRX for CI/CD + Containerlab

I've made a blog post on how to get started with containerlab and tools they offer such as vrnetlab. It serves as a guide for containerizing VM-based applications like the vSRX so that you can use them in CI/CD jobs.

14 Upvotes

3 comments sorted by

2

u/teridon 5d ago

Thanks for putting this together. I no longer deal with network infrastructure but this would have been helpful when I was working with it.

I'll point out that when you have as many dependencies as you need for juniper, you probably want to be using ansible execution environments. You can roll your own or use someone else's:

https://github.com/GiuffreLab/awx-juniper-ee

2

u/iambryant_ 5d ago

Thanks for pointing that out. That is absolutely something I've been needing to do that I've been putting off, especially with all the PEP668 warnings. I'm either going to move from running plain Ansible commands on my laptop to ansible-navigator, or a dedicated controller like Semaphore (probably not Tower/AWX, haven't learned Kubernetes yet, lol).

1

u/hailkinghomer 6h ago

Not sure how it fits in with yours but here's a lab example we put together: https://github.com/vernetau/automation-for-amateurs