Ce contenu n'est pas disponible dans la langue sélectionnée.
Chapter 10. Using the Ignition tool for the RHEL for Edge Simplified Installer images
RHEL for Edge uses the Ignition tool to inject the user configuration into the images at an early stage of the boot process. The user configuration that the Ignition tool injects includes:
- The user configuration.
- Writing files, such as regular files, and systemd units.
On the first boot, Ignition reads its configuration either from a remote URL or a file embedded in the simplified installer ISO. Then, Ignition applies that configuration into the image.
10.1. Creating an Ignition configuration file Copier lienLien copié sur presse-papiers!
The Butane tool is the preferred option to create an Ignition configuration file. Butane consumes a Butane Config YAML file and produces an Ignition Config in the JSON format. The JSON file is used by a system on its first boot. The Ignition Config applies the configuration in the image, such as user creation, and systemd units installation.
Prerequisites
You have installed the Butane tool version v0.17.0:
sudo dnf/yum install -y butane
$ sudo dnf/yum install -y butaneCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Procedure
Create a
Butane Configfile and save it in the.buformat. You must specify thevariantentry asr4e, and theversionentry as1.0.0, for RHEL for Edge images. The butaner4evariant on version 1.0.0 targets Ignition spec version3.3.0. The following is a Butane Config YAML file example:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Run the following command to consume the
Butane Config YAMLfile and generate an Ignition Config in the JSON format:./path/butane example.bu {"ignition":{"config":{"merge":[{"source":"http://192.168.122.1:8000/sample.ign"}]},"timeouts":{"httpTotal":30},"version":"3.3.0"},"passwd":{"users":[{"groups":["wheel"],"name":"core","passwordHash":"password_hash_here","sshAuthorizedKeys":["ssh-ed25519 some-ssh-key-here"]}]},"storage":{"files":[{"path":"/etc/NetworkManager/system-connections/enp1s0.nmconnection","contents":{"compression":"gzip","source":"data:;base64,H4sIAAAAAAAC/0yKUcrCMBAG3/csf/ObUKQie5LShyX5SgPNNiSr0NuLgiDzNMPM8VBFtHzoQjkxtPp+ITsrGLahKYyyGtoqEYNKwfeZc32OC0lKDb179rfg/HVyPgQ3hv8w/v0WT0k7T+7D/S1Dh7S4MRU5h1XyzqvsHVRg25G4iD5kp1cAAAD//6Cvq2ihAAAA"},"mode":384},{"path":"/usr/local/bin/startup.sh","contents":{"source":"data:;base64,IyEvYmluL2Jhc2gKZWNobyAiSGVsbG8sIFdvcmxkISIK"},"mode":493}]},"systemd":{"units":[{"contents":"[Unit]\nDescription=A hello world\n[Install]\nWantedBy=multi-user.target","enabled":true,"name":"hello.service"},{"dropins":[{"contents":"[Service]\nEnvironment=LOG_LEVEL=trace\n","name":"log_trace.conf"}],"name":"fdo-client-linuxapp.service"}]}}$ ./path/butane example.bu {"ignition":{"config":{"merge":[{"source":"http://192.168.122.1:8000/sample.ign"}]},"timeouts":{"httpTotal":30},"version":"3.3.0"},"passwd":{"users":[{"groups":["wheel"],"name":"core","passwordHash":"password_hash_here","sshAuthorizedKeys":["ssh-ed25519 some-ssh-key-here"]}]},"storage":{"files":[{"path":"/etc/NetworkManager/system-connections/enp1s0.nmconnection","contents":{"compression":"gzip","source":"data:;base64,H4sIAAAAAAAC/0yKUcrCMBAG3/csf/ObUKQie5LShyX5SgPNNiSr0NuLgiDzNMPM8VBFtHzoQjkxtPp+ITsrGLahKYyyGtoqEYNKwfeZc32OC0lKDb179rfg/HVyPgQ3hv8w/v0WT0k7T+7D/S1Dh7S4MRU5h1XyzqvsHVRg25G4iD5kp1cAAAD//6Cvq2ihAAAA"},"mode":384},{"path":"/usr/local/bin/startup.sh","contents":{"source":"data:;base64,IyEvYmluL2Jhc2gKZWNobyAiSGVsbG8sIFdvcmxkISIK"},"mode":493}]},"systemd":{"units":[{"contents":"[Unit]\nDescription=A hello world\n[Install]\nWantedBy=multi-user.target","enabled":true,"name":"hello.service"},{"dropins":[{"contents":"[Service]\nEnvironment=LOG_LEVEL=trace\n","name":"log_trace.conf"}],"name":"fdo-client-linuxapp.service"}]}}Copy to Clipboard Copied! Toggle word wrap Toggle overflow After you run the
Butane Config YAMLfile to check and generate theIgnition Config JSONfile, you might get warnings when using unsupported fields, like partitions, for example. You can fix those fields and rerun the check.
You have now an Ignition JSON configuration file that you can use to customize your blueprint.
10.2. Creating a blueprint in the GUI with support to Ignition Copier lienLien copié sur presse-papiers!
When building a Simplified Installer image, you can customize your blueprint by entering the following details in the Ignition page of the blueprint:
-
Firstboot URL- You must enter a URL that points to the Ignition configuration that will be fetched during the first boot. It can be used for both the raw image and simplified installer image. -
Embedded Data- You must provide thebase64encodedIgnition Configurationfile. It can be used only for the Simplified Installer image.
To customize your blueprint for a simplified RHEL for Edge image with support to Ignition configuration using the Ignition blueprint customization, follow the steps:
Prerequisites
- You have opened the image builder app from web console in a browser. See Accessing the image builder GUI in the RHEL web console.
-
To fully support the embedded section,
coreos-installer-dracuthas to be able to define-ignition-url|-ignition-filebased on the presence of the OSBuild’s file.
Procedure
Click in the upper-right corner.
A dialog wizard with fields for the blueprint name and description opens.
On the
Detailspage:- Enter the name of the blueprint and, optionally, its description. Click .
On the
Ignitionpage, complete the following steps:-
On the
Firstboot URLfield, enter the URL that points to the Ignition configuration to be fetched during the first boot. -
On the
Embedded Datafield, drag or upload thebase64encodedIgnition Configurationfile. Click .
-
On the
- Review the image details and click .
The image builder dashboard view opens, listing the existing blueprints.
Next
- You can use the blueprint you created to build your Simplified Installer image. See Creating a RHEL for Edge Simplified Installer image using image builder CLI.
10.3. Creating a blueprint with support to Ignition using the CLI Copier lienLien copié sur presse-papiers!
When building a simplified installer image, you can customize your blueprint by adding the customizations.ignition section to it. With that, you can create either a simplified installer image or a raw image that you can use for the bare metal platforms. The customizations.ignition customization in the blueprint enables the configuration files to be used in edge-simplified-installer ISO and edge-raw-image images.
For the
edge-simplified-installerISO image, you can customize the blueprint to embed an Ignition configuration file that will be included in the ISO image. For example:[customizations.ignition.embedded] config = "eyJ --- BASE64 STRING TRIMMED --- 19fQo="
[customizations.ignition.embedded] config = "eyJ --- BASE64 STRING TRIMMED --- 19fQo="Copy to Clipboard Copied! Toggle word wrap Toggle overflow You must provide a
base64encoded Ignition configuration file.For both the
edge-simplified-installerISO image and also theedge-raw-image, you can customize the blueprint, by defining a URL that will be fetched to obtain the Ignition configuration at the first boot. For example:[customizations.ignition.firstboot] url = "http://your_server/ignition_configuration.ig"
[customizations.ignition.firstboot] url = "http://your_server/ignition_configuration.ig"Copy to Clipboard Copied! Toggle word wrap Toggle overflow You must enter a URL that points to the Ignition configuration that will be fetched during the first boot.
To customize your blueprint for a Simplified RHEL for Edge image with support to Ignition configuration, follow the steps:
Prerequisites
-
If using the
[customizations.ignition.embedded]customization, you must create an Ignition configuration file. -
If using the
[customizations.ignition.firstboot]customization, you must have created a container whose URL points to the Ignition configuration that will be fetched during the first boot. -
The blueprint customization
[customizations.ignition.embedded]section enablescoreos-installer-dracutto define-ignition-url|-ignition-filebased on the presence of the osbuild’s file.
Procedure
Create a plain text file in the Tom’s Obvious, Minimal Language (TOML) format, with the following content:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Where:
-
The
nameis the name anddescriptionis the description for your blueprint. -
The
versionis the version number according to the Semantic Versioning scheme. -
The
modulesandpackagesdescribe the package name and matching version glob to be installed into the image. For example, the packagename = "tmux"and the matching version glob isversion = "3.3a". Notice that currently there are no differences between packages and modules. The
groupsare packages groups to be installed into the image. For examplegroups = "anaconda-tools"group package. If you do not know the modules and groups, leave them empty.WarningIf you want to create a user with Ignition, you cannot use the FDO customizations to create a user at the same time. You can create users using Ignition and copy configuration files using FDO. But if you are creating users, create them using Ignition or FDO, but not both at the same time.
-
The
Push (import) the blueprint to the image builder server:
composer-cli blueprints push blueprint-name.toml
# composer-cli blueprints push blueprint-name.tomlCopy to Clipboard Copied! Toggle word wrap Toggle overflow List the existing blueprints to check whether the created blueprint is successfully pushed and exists.
composer-cli blueprints show blueprint-name
# composer-cli blueprints show blueprint-nameCopy to Clipboard Copied! Toggle word wrap Toggle overflow Check whether the components and versions listed in the blueprint and their dependencies are valid:
composer-cli blueprints depsolve blueprint-name
# composer-cli blueprints depsolve blueprint-nameCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Next
- You can use the blueprint you created to build your Simplified Installer image. See Creating a RHEL for Edge Simplified Installer image using image builder CLI.
Additional resources