Este conteúdo não está disponível no idioma selecionado.
Chapter 8. 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.
8.1. Creating an Ignition configuration file
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
Procedure
Create a
Butane Config
file and save it in the.bu
format. You must specify thevariant
entry asr4e
, and theversion
entry as1.0.0
, for RHEL for Edge images. The butaner4e
variant on version 1.0.0 targets Ignition spec version3.3.0
. The following is a Butane Config YAML file example:variant: r4e version: 1.0.0 ignition: config: merge: - source: http://192.168.122.1:8000/sample.ign passwd: users: - name: core groups: - wheel password_hash: password_hash_here ssh_authorized_keys: - ssh-ed25519 some-ssh-key-here storage: files: - path: /etc/NetworkManager/system-connections/enp1s0.nmconnection contents: inline: | [connection] id=enp1s0 type=ethernet interface-name=enp1s0 [ipv4] address1=192.168.122.42/24,192.168.122.1 dns=8.8.8.8; dns-search= may-fail=false method=manual mode: 0600 - path: /usr/local/bin/startup.sh contents: inline: | #!/bin/bash echo "Hello, World!" mode: 0755 systemd: units: - name: hello.service contents: | [Unit] Description=A hello world [Install] WantedBy=multi-user.target enabled: true - name: fdo-client-linuxapp.service dropins: - name: log_trace.conf contents: | [Service] Environment=LOG_LEVEL=trace
Run the following command to consume the
Butane Config YAML
file 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"}]}}
After you run the
Butane Config YAML
file to check and generate theIgnition Config JSON
file, 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.
Additional resources
8.2. Creating a blueprint in the GUI with support to Ignition
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 thebase64
encodedIgnition Configuration
file. 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-dracut
has to be able to define-ignition-url
|-ignition-file
based 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
Details
page:- Enter the name of the blueprint and, optionally, its description. Click .
On the
Ignition
page, complete the following steps:-
On the
Firstboot URL
field, enter the URL that points to the Ignition configuration to be fetched during the first boot. -
On the
Embedded Data
field, drag or upload thebase64
encodedIgnition Configuration
file. 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.
8.3. Creating a blueprint with support to Ignition using the CLI
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-installer
ISO 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="
You must provide a
base64
encoded Ignition configuration file.For both the
edge-simplified-installer
ISO 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"
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-dracut
to define-ignition-url
|-ignition-file
based 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:
name = "simplified-installer-blueprint" description = "Blueprint with Ignition for the simplified installer image" version = "0.0.1" packages = [] modules = [] groups = [] distro = "" [customizations.ignition.embedded] config = "eyJ --- BASE64 STRING TRIMMED --- 19fQo="
Where:
-
The
name
is the name anddescription
is the description for your blueprint. -
The
version
is the version number according to the Semantic Versioning scheme. -
The
modules
andpackages
describe 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
groups
are 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
List the existing blueprints to check whether the created blueprint is successfully pushed and exists.
# composer-cli blueprints show blueprint-name
Check whether the components and versions listed in the blueprint and their dependencies are valid:
# composer-cli blueprints depsolve blueprint-name
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