Ignition follows a specific lifecycle during boot to fetch, process, and apply configurations. The flow depends on whether the system is performing a 'firstboot' or a 'subsequent' boot.
1. Firstboot Detection
- GRUB Stage: The bootloader checks for the existence of
/ignition.firstboot on the boot filesystem. If present, it appends ignition.firstboot (and optionally ignition_network_kcmdline) to the kernel command line. - Generator Stage: The
ignition-generator reads /proc/cmdline. If ignition.firstboot is detected, the firstboot path is triggered; otherwise, the system proceeds to a subsequent boot where Ignition services do not run.
2. Configuration Fetching
Ignition attempts to locate a configuration file (/run/ignition.json) using the following priority:
- Kernel Command Line: Config provided directly via arguments.
- Local File: The existence of
/usr/lib/ignition/user.ign. - Platform Provider: Fetching from the cloud/platform provider (e.g., Azure IMDS).
If the configuration requires network resources, ignition-fetch.service will wait for the network to be available before attempting to fetch.
3. Application Lifecycle
Once a configuration is found and written to /run/ignition.json, the following services execute in order:
ignition-kargs.service: Processes kernel arguments. If changes are detected, the system reboots to apply them.ignition-disks.service: Manages disk partitioning and formatting.ignition-mount.service: Mounts filesystems.ignition-files.service: Merges the configuration with base configs and applies files/units.
4. Completion
After ignition-complete.target is reached, the system pivots to the real root. If it was a firstboot, ignition-delete-config.service may run to clean up the configuration to prevent re-application on subsequent boots.