Jinja2

Note

This chapter covers the Buildah based workflow v2.

A closer look at the edi-pi configuration reveals some parametrization: The file configuration/base/common.yml contains a line that dynamically derives the name of an artifact from the project name (location: {{ edi_configuration_name }}_bootstrapped-rootfs.tar). Jinja2 will replace the expression {{ edi_configuration_name }} with the name of the configuration.

The following command can be used to display the dictionary that is available for Jinja2 operations when loading the configuration pi5.yml:

edi project make --dictionary pi5.yml

Since the dictionary is context sensitive to the sub-command you have to specify the full command with the additional option --dictionary to display the appropriate dictionary. The option --dictionary is available for all commands that deal with configuration.

--dictionary

Dumps the load time dictionary instead of running the command.

Plugins can even further benefit from Jinja2 since there are additional dictionary entries available. The option --plugins will output the details:

edi project make --plugins pi5.yml

If supported for the plugin, edi will preview the plugin rendered by Jinja2 when using the above command. Given the plugin is an Ansible playbook, the whole plugin dictionary will be made available to the playbook by means of the Ansible command line option --extra-vars.

--plugins

Dumps the active plugins including their dictionaries instead of running the command.