Custom Templates for eos_designs¶
With Custom Templates for the
eos_designs role, the user can create additional structured configuration variables that would otherwise not be created by the built-in templates.
These additional variables will then be available for use by other AVD roles.
For example, the user may require additional structured configuration variables to render a custom template the user has created for the
Create a Custom Template¶
Custom templates should be written in Jinja2.
For details on how to create Jinja2 templates, see Templating Jinja2.
eos_designs searches for custom templates in several locations; therefore, custom templates should be saved in one of these locations:
The “templates” folders do not exist by default, so they will need to be created if the user chooses that location.
As with any AVD variable, additional structured configuration variables will be subject to validation against the schema. Because they are custom variables, additional structured configuration variables will not be included in the existing schema and will produce warning messages. Custom variables should start with an underscore if you would like to bypass validation.
Adding the Custom Template to group vars¶
For the custom template to be automatically discovered and rendered by
eos_designs, a variable that references the template should be added to the inventory group vars.
The format of the variable should be as follows:
For more details, see Custom Templates.
Adding the Custom Template to the
Custom templates are rendered automatically when the
eos_designs_custom_templates variable is set. The custom templates are always rendered after the builtin
eos_designs features, so any output of
eos_designs can be accessed and overridden.