Debian Codegraph @

doc/source/concept_and_workflow/runtime_configuration.rst

raw
1 .. _runtime_config:
2
3 The Runtime Configuration File
4 ------------------------------
5
6 {kiwi} supports an additional configuration file for runtime-specific
7 settings that do not belong in the image description but which are
8 persistent and are unsuitable for command-line parameters.
9
10 The runtime configuration file must adhere to the `YAML <https://yaml.org/>`_
11 format. {kiwi} reads **every** one of the following locations that exists and
12 merges them, with later entries overriding earlier ones:
13
14 1. :file:`/usr/share/kiwi/kiwi.yml` (vendor)
15
16 2. every :file:`*.yml` in :file:`/usr/share/kiwi/kiwi.yml.d/`, alphabetically
17
18 3. :file:`/etc/kiwi.yml` (administrator)
19
20 4. every :file:`*.yml` in :file:`/etc/kiwi.yml.d/`, alphabetically
21
22 5. :file:`~/.config/kiwi/config.yml`
23
24 6. the file passed via the global `--config` option
25
26 `--config` does not replace the standard lookup, it is merged last and
27 has the highest precedence.
28
29 Both drop-in directories are always scanned, whether or not the corresponding
30 main file exists. A system with no :file:`/etc/kiwi.yml` still loads
31 :file:`/etc/kiwi.yml.d/*.yml`. This allows for modular configuration management,
32 where different aspects of the configuration can be separated into different
33 files.
34
35 .. warning::
36
37 Merging happens at the **top level only**. A file that defines a section
38 replaces that whole section from earlier files. Individual keys inside
39 sections are not merged.
40
41 For example, if :file:`/usr/share/kiwi/kiwi.yml` contains
42
43 .. code:: yaml
44
45 bundle:
46 - compress: true
47 - shasum_size: "512"
48
49 and :file:`/etc/kiwi.yml.d/10-local.yml` contains
50
51 .. code:: yaml
52
53 bundle:
54 - compress: false
55
56 then the effective `shasum_size` is **not** ``"512"``. The whole `bundle`
57 section is replaced, so `shasum_size` falls back to its default.
58
59 A default runtime config file in :file:`/usr/share/kiwi/kiwi.yml.example` is
60 provided with the `python3-kiwi` main package. The file contains the available
61 settings as comments, including a short description of each setting.