5.16. Kickstart file injection in an ISO image
You can use the [customizations.installer] blueprint customization to add your own Kickstart file in your builds for ISO installers, such as image installer, and gain more flexibility when building ISO images for bare metal deployments.
Booting the ISO on a machine with an existing operating system or data can be destructive, because the Kickstart is configured to automatically reformat the first disk on the system.
You can choose the following options to add your own Kickstart file:
- Setting all values during the installation process.
-
Enabling the
unattended = truefield in the Kickstart, and getting a fully unattended installation with defaults. Injecting your own Kickstart by using the Kickstart field. This can result in either a fully unattended installation if you specify all required fields, or the installation program prompts you for some fields that might be missing.
The Anaconda installer ISO image types support the following blueprint customization:
[customizations.installer] unattended = true sudo-nopasswd = ["user", "%wheel"]unattended: Creates a Kickstart file that fully automates the installation. This includes setting the following options by default:- text display mode
-
en_US.UTF-8language and locale -
us keyboardlayout -
UTC time zone -
zerombr,clearpart, andautopartto automatically wipe and partition the first disk -
network options to enable
dhcpandauto-activation
The following is an example:
liveimg --url file:///run/install/repo/liveimg.tar.gz
lang en_US.UTF-8
keyboard us
timezone UTC
zerombr
clearpart --all --initlabel
text
autopart --type=plain --fstype=xfs --nohome
reboot --eject
network --device=link --bootproto=dhcp --onboot=on --activate
sudo-nopasswd: Adds a snippet to the Kickstart file that, after installation, creates drop-in files in /etc/sudoers.d to allow the specified users and groups to run sudo without a password. The groups must be prefixed with %. For example, setting the value to ["user", "%wheel"] creates the following Kickstart %post section:
%post
echo -e "user\tALL=(ALL)\tNOPASSWD: ALL" > "/etc/sudoers.d/user"
chmod 0440 /etc/sudoers.d/user
echo -e "%wheel\tALL=(ALL)\tNOPASSWD: ALL" > "/etc/sudoers.d/%wheel"
chmod 0440 /etc/sudoers.d/%wheel
restorecon -rvF /etc/sudoers.d
%end
As an alternative, you can include a custom Kickstart by using the following customization:
[customizations.installer.kickstart]
contents = """
text --non-interactive
zerombr
clearpart --all --initlabel --disklabel=gpt
autopart --noswap --type=lvm
network --bootproto=dhcp --device=link --activate --onboot=on
"""
image-builder automatically adds the command that installs the system: liveimg, if it is relevant for the image-installer image type. You cannot use the [customizations.installer.kickstart] customization in combination with any other installer customizations.