Category: Automation

Using Visual Studio Code for creating Network Code

When I started on my network automation journey, I didn’t pay too much attention to what I was using when creating my code. I knew that programmers used Integrated Development Environments (IDEs), but since I was mostly editing smaller text files I kept to simple text editors like Nano or Vi. I attended Red Hat’s AnsibleFest in Austin, TX and saw that many people in the network world (both vendor reps and other network engineers) would use much more advanced text editors. One of the most popular ones being used was Atom. I ended up having a conversation with some other co-workers and a few Red Hat reps, and some suggested trying out Microsoft’s Visual Studio Code (commonly referred to VS Code). After having some time to try out both, I have chosen to stick with VS Code. While this blog post isn’t going to do a side by side comparison of text editors, it will show some of the highlights that led me to choose VS Code when creating network code.

Continue reading “Using Visual Studio Code for creating Network Code”

Network Configuration Templates with Ansible and Jinja2

In a previous blog post I showed how to utilize Python to create a script that will generate network configurations from templates utilizing Jinja2. While the solution did work, creating scripts from scratch using a programming language can be a daunting task for network engineers. Luckily for us, there are already tools in place that we can leverage to do the heavy lifting for us. Today we will look at Ansible to generate network device configurations from templates.

Continue reading “Network Configuration Templates with Ansible and Jinja2”

Commit to Git

Introduction

Git is one of the most popular version control systems out today. With network automation and scripting becoming more and more popular, there needs to be a way to store and track changes made to scripts and configuration files. Not only will Git allow you to do that, but it can also help collaborate with colleagues (via a private Git system) or with the rest of the world (GitHub). GitHub is a site that you can go to and upload your own creations, as well as browse through the work of others. GitHub is built on Git. Let’s go ahead and dive right into the world of Git and GitHub. First, I will upload the code I created in my last post, and after that I will download some code written by Ivan Pepelnjak and shared on his GitHub page.

Continue reading “Commit to Git”

Network Automation: Template Configurations with Jinja2 and YAML

Introduction

Network automation and programmability is one of the hot topics in networking today. It is one area that I want to focus on this year and become very familiar with. One of the best resources that I found was the book “Network Programmability and Automation, 1st Edition” by Jason Edelman, Scott Lowe, and Matt Oswalt. Although it is only available in a pre-release (incomplete) version, if you have a Safari Books subscription I highly recommend checking it out. This book not only is extremely easy to ready, but it gives the high level ideas and theory that I feel is desperately needed for us network engineers. This whole programming idea is foreign to a lot of us, and just jumping right into coding can be a very daunting and intimidating task. This book is what gave me the clarity to feel confident enough to dive into automation.

In this blog post I will utilize a code example from the book that will allow you to automate network configuration templates. We will be using Python, Jinja2, and YAML. It is easy, low hanging fruit that will allow you to get your feet wet, and at the same time actually put this whole progamming and automation to practical use that every engineer can relate to.

Continue reading “Network Automation: Template Configurations with Jinja2 and YAML”