You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/content/en/docs/Customizing/stages.md
+18-2Lines changed: 18 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,19 +14,35 @@ We have a custom augmented cloud-init syntax that allows to hook into various st
14
14
- Network availability
15
15
- During upgrades, installation, deployments , and resets
16
16
17
-
Cloud-init files in `/system/oem`, `/oem` and `/usr/local/oem` are applied in 5 different phases: `boot`, `network`, `fs`, `initramfs` and `reconcile`. All the available cloud-init keywords can be used in each stage. Additionally, it's possible also to hook before or after a stage has run, each one has a specific stage which is possible to run steps: `boot.after`, `network.before`, `fs.after` etc.
17
+
Cloud-init files in `/system/oem`, `/oem`, `/usr/local/oem`, and kernel boot args are applied in 5 different phases: `boot`, `network`, `fs`, `initramfs` and `reconcile`. All the available cloud-init keywords can be used in each stage. Additionally, it's possible also to hook before or after a stage has run, each one has a specific stage which is possible to run steps: `boot.after`, `network.before`, `fs.after` etc.
18
18
19
19
Multiple stages can be specified in a single cloud-init file.
20
20
21
+
File extension name must be *.yaml or *.yml.
22
+
21
23
{{% alert title="Note" %}}
22
-
When a Elemental derivative boots it creates sentinel files in order to allow to execute cloud-init steps programmaticaly.
24
+
When an Elemental derivative boots it creates sentinel files in order to allow executing cloud-init steps programmatically.
23
25
24
26
-`/run/cos/recovery_mode` is being created when booting from the recovery partition
25
27
-`/run/cos/live_mode` is created when booting from the LiveCD
26
28
27
29
To execute a block using the sentinel files you can specify: `if: '[ -f "/run/cos/..." ]'`, see the examples below.
28
30
{{% /alert %}}
29
31
32
+
At every stage, Elemental derivative parse and execute Cloud-init files in the following order:
Copy file name to clipboardExpand all lines: docs/content/en/docs/Reference/cloud_init.md
+8-1Lines changed: 8 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -85,7 +85,14 @@ stages:
85
85
The default cloud-config format is split into *stages* (*initramfs*, *boot*, *network*, *initramfs*, *reconcile*, called generically **STAGE_ID** below) [see also stages](../../customizing/stages) that are emitted internally during the various phases by calling `cos-setup STAGE_ID`.
86
86
*steps* (**STEP_NAME** below) defined for each stage are executed in order.
87
87
88
-
Each cloud-config file is loaded and executed only at the apprioriate stage, this allows further components to emit their own stages at the desired time.
88
+
Each cloud-config file is loaded and executed only at the appropriate stage, this allows further components to emit their own stages at the desired time.
89
+
90
+
_Note_:
91
+
- The execution order of multiple `substeps` (such as `files`, `commands`, `environment` etc.) within a single `step` is not guaranteed.
92
+
Therefore, when you have multiple `substeps` that related to each other, please do not define them in a single `step`.
93
+
Instead, you can split the `substeps` into multiple `steps` which are ensured to be executed by the definition order.
94
+
- The name of `steps` and output of `substeps` will be output to system journal log which can be viewed by the command `journalctl -u 'elemental*'`.
95
+
- It is highly recommended to declare the `name` property of *steps*, so that it will be easier to investigate the output of `journalctl -u 'elemental*'` by the name.
89
96
90
97
{{% pageinfo %}}
91
98
The [cloud-init tool](https://github.com/mudler/yip#readme) can be also run standalone, this helps debugging locally and also during development, you can find separate [releases here](https://github.com/mudler/yip/releases).
0 commit comments