Chapter 7. Configuring the discovery image
The Assisted Installer uses a preconfigured discovery image to run an agent that performs hardware and network validations before installing OpenShift Container Platform. You can customize this discovery image by using a utility called Ignition. Changes to the discovery image are not saved and apply only during the current validation run.
7.1. Creating an Ignition configuration file Copy linkLink copied to clipboard!
Ignition is a low-level system configuration utility, which is part of the temporary initial root filesystem, the initramfs. When Ignition runs on the first boot, it finds configuration data in the Ignition configuration file and applies it to the host before switch_root is called to pivot to the host’s root filesystem.
Ignition uses a JSON configuration specification file to represent the set of changes that occur on the first boot.
Ignition versions newer than 3.2 are not supported, and will raise an error.
Procedure
Create an Ignition file and specify the configuration specification version:
$ vim ~/ignition.conf{ "ignition": { "version": "3.1.0" } }Add configuration data to the Ignition file. For example, add a password to the
coreuser.Generate a password hash:
$ openssl passwd -6Add the generated password hash to the
coreuser:{ "ignition": { "version": "3.1.0" }, "passwd": { "users": [ { "name": "core", "passwordHash": "$6$spam$M5LGSMGyVD.9XOboxcwrsnwNdF4irpJdAWy.1Ry55syyUiUssIzIAHaOrUHr2zg6ruD8YNBPW9kW0H8EnKXyc1" } ] } }
Save the Ignition file and export it to the
IGNITION_FILEvariable:$ export IGNITION_FILE=~/ignition.conf
7.2. Modifying the discovery image with Ignition Copy linkLink copied to clipboard!
After you create an Ignition configuration file, you can modify the discovery image by patching the infrastructure environment through the Assisted Installer API.
Prerequisites
- If you used the web console to create the cluster, you have set up the API authentication.
-
You have an infrastructure environment and you have exported the infrastructure environment
idto theINFRA_ENV_IDvariable. -
You have a valid Ignition file and have exported the file name as
$IGNITION_FILE.
Procedure
Create an
ignition_config_overrideJSON object and redirect it to a file:$ jq -n \ --arg IGNITION "$(jq -c . $IGNITION_FILE)" \ '{ignition_config_override: $IGNITION}' \ > discovery_ignition.jsonRefresh the API token:
$ source refresh-tokenPatch the infrastructure environment:
$ curl \ --header "Authorization: Bearer $API_TOKEN" \ --header "Content-Type: application/json" \ -XPATCH \ -d @discovery_ignition.json \ https://api.openshift.com/api/assisted-install/v2/infra-envs/$INFRA_ENV_ID | jqThe
ignition_config_overrideobject references the Ignition file.- Download the updated discovery image.