This documentation is for a release that is no longer maintained
See documentation for the latest supported version 3 or the latest supported version 4.Ce contenu n'est pas disponible dans la langue sélectionnée.
Chapter 7. Configuring the discovery image
The Assisted Installer uses an initial image to run an agent that performs hardware and network validations before attempting to install OpenShift Container Platform. You can use Ignition to customize the discovery image.
Modifications to the discovery image will not persist in the system.
7.1. Creating an Ignition configuration file Copier lienLien copié sur presse-papiers!
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
$ vim ~/ignition.confCopy to Clipboard Copied! Toggle word wrap Toggle overflow { "ignition": { "version": "3.1.0" } }{ "ignition": { "version": "3.1.0" } }Copy to Clipboard Copied! Toggle word wrap Toggle overflow Add configuration data to the Ignition file. For example, add a password to the
coreuser.Generate a password hash:
openssl passwd -6
$ openssl passwd -6Copy to Clipboard Copied! Toggle word wrap Toggle overflow Add the generated password hash to the
coreuser:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Save the Ignition file and export it to the
IGNITION_FILEvariable:export IGNITION_FILE=~/ignition.conf
$ export IGNITION_FILE=~/ignition.confCopy to Clipboard Copied! Toggle word wrap Toggle overflow
7.2. Modifying the discovery image with Ignition Copier lienLien copié sur presse-papiers!
Once you create an Ignition configuration file, you can modify the discovery image by patching the infrastructure environment using the Assisted Installer API.
Prerequisites
- If you used the UI 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.json$ jq -n \ --arg IGNITION "$(jq -c . $IGNITION_FILE)" \ '{ignition_config_override: $IGNITION}' \ > discovery_ignition.jsonCopy to Clipboard Copied! Toggle word wrap Toggle overflow Refresh the API token:
source refresh-token
$ source refresh-tokenCopy to Clipboard Copied! Toggle word wrap Toggle overflow Patch the infrastructure environment:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow The
ignition_config_overrideobject references the Ignition file.- Download the updated discovery image.