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 figure is about the ISP topology using template-based configuration: