So as we were playing around with Ansible on our SRX’s we ended up breaking one of them. The status light became red and we got stuck at the db> prompt. We tried different commands from that prompt and nothing worked, the device was rebooting and a ‘file system full’ error was showing up and after 30-40 seconds we were again at the db> prompt.
Use Juniper Device Console Port with Ansible
Ansible is a very powerful tool for automating provisioning and maintenance tasks on Junos devices using the Py-EZ module. Usually you require at least SSH or Netconf set on the device for ansible to work but there will be times a student breaks your ansible-able configuration. Using the Juniper device’s console port we can have Ansible re-upload a configuration. In this guide we are just establishing a connection using the USB to RJ-45 console port and getting the Junos device information.
Continue reading
Using Bash Script Variables with Ansible Playbooks
This bash script works interactively. We wanted a way to reboot a specific Juniper router that would be easy for the user to manage. The Ansible bash script makes use of Ansible’s extra-vars feature which allows you to pass a variable into an Ansible playbook from a bash shell script.
Continue reading
Create Observium Virtual Machine with Vagrant
Observium is a management software that runs on any device that can run a web server like Apache with PHP so we plan to run it on a Banana Pi. Observium will use SNMP to manage 16 Juniper SRX240 and 8 EX4200 devices. I wanted to test SNMPv3 settings on Junos and Observium virtually before moving into production. This guide assumes you have Vagrant and Virtualbox installed already. This script spins up an Ubuntu or Debian box and runs this shell script to automatically install Observium.
Use Ansible to Upgrade Junos Software on Vagrant VM
This guide assumes you are using the Vagrant Junos guide with Firefly Perimeter boxes. You will need to get the upgrade file from here (requires Junos account). We used this method to test Ansible before using it on 16 SRX 240 routers and 8 EX4200 switches.
Continue reading
Use Python for Batch Commands on Junos Vagrant Machines
Sometimes you have to enter a long list of commands to configure some service on Juniper devices. While it’s great practice for learning the command line sometimes you want things to go quickly. We were setting up Observium to manage SNMP on SRX devices in the lab and setting SNMP up is a long list of 20-something commands. This guide will show you how to use a text file filled with Junos commands and have python connect to the Juniper device and execute them all for you. It works on Linux (tested on Debian and Ubuntu) and Windows 8, 10.
Continue reading
Use Ansible to Install Config on Junos Virtual Machine
This guide assumes you already have Junos Vagrant virtual machines up and running with Ansible. You will be able to test an Ansible playbook for installing a custom Junos configuration. It will work on Ubuntu and Debian host machines.
Continue reading
Prepare Juniper’s SRX240 for Ansible
According to Juniper’s official documentation regarding Ansible, SRX240 is not a supported device. The Junos-PyEZ python module that is used to remotely configure Juniper devices is the same for all the devices, so since we have some of those SRX’s in our lab we decided to give it a shot and see what happens.
Continue reading
Use Python with Junos Vagrant Virtual Machines
If you want to test using python to control Junos devices, you can do so with your Juniper Vagrant virtual machines. It makes it very easy to spin up and destroy Juniper virtual machines using Vagrant and Virtualbox. You can also test without having a physical Juniper ERX, SRX or other Junos device. This will work on Windows as long as you have installed Python 2.7.10 and make python part of your PATH variable (can be done during installation).
Continue reading
Use Vagrant with Juniper Junos VMs on Ubuntu
This is a short guide for using Vagrant with Virtual box to spin up Juniper Junos virtual machines on Ubuntu. It makes practicing your Juniper Junos skills without an EX or SRX device possible.
Continue reading