Yaml Based Configuration
Note
This chapter covers the Buildah based workflow v2.
The configuration is split into several sections. The following command will dump the merged and rendered configuration of the Raspberry Pi 5 image build:
cd edi-workspace/edi-pi
edi project make --config pi5.yml
- --config
Dump the merged configuration instead of running the command.
general
Section
The general section contains the information that might affect all other sections.
edi supports the following settings:
Ordered Node Section
In order to understand the following sections we have to introduce the concept of an ordered node section. In Unix based
systems it is quite common to split configurations into a set of small configuration files (see e.g.
/etc/sysctl.d
). Those small configuration files are loaded and applied according to their alphanumerical order.
edi does a very similar thing in its ordered node sections. Here is an example:
dog_tasks:
10_first_task:
job: bark
20_second_task:
job: sleep
dog_tasks:
20_second_task:
job: sleep
10_first_task:
job: bark
In both examples above the dog will first bark and then sleep because of the alphanumerical order of the nodes
10_first_task
and 20_second_task
. The explicit order of the nodes makes it easy to add or modify a
certain node using Overlays.
Plugin Node
Most of the ordered node sections contain nodes that specify and parametrize plugins.
A typical node looks like this:
preprocessing_commands:
050_mmdebstrap:
output:
edi_bootstrapped_rootfs:
location: pi5_bootstrapped-rootfs.tar
type: path
path: preprocessing_commands/bootstrap/mmdebstrap.edi
Such nodes accept the following settings:
- --dictionary
Dumps the load time dictionary instead of running the command.
To learn more about plugins please read the chapter Plugins.
preprocessing_commands
Section
The preprocessing_commands section is an ordered node section consisting of plugin nodes. The preprocessing commands can be written in any language of choice. Preprocessing command nodes require an explicit declaration of the generated artifacts. Please read the chapter Plugins for more details.
playbooks
Section
The playbooks section is an ordered node section consisting of plugin nodes. Please consult the Ansible documentation if you want to write custom playbooks.
Note
For workflow v2, it is strongly recommended to use only one playbook.
postprocessing_commands
Section
The postprocessing_commands section is an ordered node section consisting of plugin nodes. The postprocessing commands can be written in any language of choice. Postprocessing command nodes require an explicit declaration of the generated artifacts. Please read the chapter Plugins for more details.
documentation_steps
Section
The documentation_steps section is an ordered node section consisting
of plugin nodes. The documentation_steps section is being processed by the
edi documentation render ...
command. This command is independent of the
main workflow but it can be easily integrated as a
postprocessing command. (See edi-pi for a possible implementation.)
The command that renders the documentation gets executed as follows:
edi documentation render PATH_TO_USR_SHARE_DOC_FOLDER OUTPUT_FOLDER CONFIG.yml
From PATH_TO_USR_SHARE_DOC_FOLDER/edi
the files build.yml
(optional), packages.yml
and
packages-baseline.yml
(optional) will be retrieved. Based on the content of this files the documentation_steps
plugins will get executed.
A documentation step can look like this:
documentation_steps:
...
400_changelog:
path: documentation_steps/rst/templates/changelog.rst.j2
output:
file: changelog.rst
parameters:
edi_doc_include_changelog: True
edi_doc_changelog_baseline: 2023-12-01 00:00:00 GMT
edi_doc_replacements:
- pattern: '(?i)[#]*(Closes:\s[#])([0-9]{6,10})'
replacement: '`\1\2 <https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=\2>`_'
- pattern: '(?i)[#]*(LP:\s[#])([0-9]{6,10})'
replacement: '`\1\2 <https://bugs.launchpad.net/ubuntu/+source/nano/+bug/\2>`_'
...
path
points to a Jinja2 template that will get used to render the file declared under output/file
.
The documentation steps can be fine tuned using the following parameters:
Note
For the workflow v2 the sections bootstrap
, lxc_profiles
, lxc_templates
and
shared_folders
are no longer relevant.