O'Reilly logo

JUNOS Automation Cookbook by Adam Chappell

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Template configurations with Jinja2

In this recipe, we’ll build on the abilities from the previous recipe by using PyEZ to make configuration changes on JUNOS devices. But we’ll expand our skill set by defining a template that describes a class of change in terms of mandatory boilerplate configuration and parametric resources. We’ll use the Jinja2 template language for this.

Then we'll see how we can instantiate the template configuration, by simply specifying the parametric values each time in order to make repeated configuration changes in an efficient and error-free manner.

This type of capability is extremely useful for large-scale service providers who want to achieve deterministic, repeated configurations with low error rates. The following ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required