Customizing kickstarts

When Beaker provisions a system, the Beaker server generates an Anaconda kickstart from a template file. Beaker’s kickstart templates are written in the Jinja2 templating language. Refer to the Jinja2 documentation for details of the template syntax and built-in constructs which are available to all templates.

Beaker selects a base kickstart template according to the major version of the distro being provisioned, for example Fedora16 or RedHatEnterpriseLinux6. If no template is found under this name, Beaker will also try the major version with trailing digits stripped (Fedora, RedHatEnterpriseLinux).

The Beaker server searches the following directories for kickstart templates, in order:

  • /etc/beaker/kickstarts

    Custom templates may be placed here.

  • /usr/lib/python2.6/site-packages/bkr/server/kickstarts

    These templates are packaged with Beaker and should not be modified.

Beaker ships with kickstart templates for all current Fedora and Red Hat Enterprise Linux distros. The shipped templates include all the necessary parts to run Beaker scheduled jobs. They also provide a mechanism for customizing the generated kickstarts with template “snippets”. Administrators are recommended to use custom snippets where necessary, rather than customizing the base templates.

Administrators can test the generated kickstart for a particular system or an already completed recipe using the beaker-create-kickstart server-side command.

Kickstart snippets

Each snippet provides a small unit of functionality within the kickstart. The name and purpose of all defined snippets are given below, along with details of how administrators can selectively override them for particular distros, labs and systems.

The following snippets provide required functionality for Beaker integration, and should never be overridden by the administrator. However, they may be useful when implementing custom templates and snippets:

rhts_pre; rhts_post
Scripts necessary for running a Beaker recipe on the system after it is provisioned. Most of the other snippets listed below are included from one of these snippets rather than directly from the kickstart templates.
beah; harness
Handles installation of the default Beaker test harness (beah), or installation of an alternative harness.
Instructs the lab controller to remove the current netboot configuration for this system.
Updates the GRUB configuration if the grubport kickstart metadata variable is set.
Checks in with the lab controller to indicate that installation is complete (post-installation scripts are now proceeding) and to report the FQDN of the newly installed system.
Handles the linkdelay ks_meta variable.
Handles setting the root password for the system.
Checks in with the lab controller to indicate that post-installation scripts are complete. This snippet defines its own %post section and is placed after all other %post sections.
pre_anamon; post_anamon
Configures anamon, a small daemon which runs during the Anaconda install process and uploads log files to the Beaker scheduler.
Provides a list of packages to be installed by Anaconda, based on the packages required by and requested in the recipe.
Defines the partitions to be created by Anaconda, based on the partition configuration requested in the recipe.

For the following snippets Beaker ships a default template, which should be sufficient in most cases. However, administrators may choose to override these if necessary.


On EFI systems, Anaconda adds a new default boot entry that boots from the local disk rather than the network. To ensure Beaker can reprovision the system later, Beaker removes this entry and sets the “BootNext” setting instead. The rhts-reboot command also sets “BootNext” to the entry added by Anaconda rather than booting from the network. See Boot order for more information.

New in version 0.14.4: The boot order adjustment was moved to its own snippet, allowing it to be overridden without replacing the entirety of rhts_post.

Provides the url or nfs kickstart command which tells Anaconda where to find the distro tree for installation.
Sets environment variables on the installed system, giving the address of various services within the lab. The exact name and meaning of the environment variables are left up to the administrator, but may include for example build servers, download servers, or temporary storage servers.
Reportedly this does not work and should probably be deleted.
Provides the repo kickstart commands which tell Anaconda where to find the distro tree’s Yum repositories for installation. This includes any custom repos passed in the job XML as well, e.g. <repo name="repo_id" url="http://server/path/to/repo"/>
Sets up the system’s Yum repo configuration after install.
Disables readahead, which is known to conflict with auditd in RHEL6.
rhts_devices; rhts_scsi_ethdevices
Provides device commands (if necessary) which tell Anaconda to load additional device modules.
Adds the Beaker user’s SSH public keys to /root/.ssh/authorized_keys after installation, so that they can log in using SSH key authentication.
Provides the timezone kickstart command. The default timezone is “America/New_York”. Administrators may wish to customize this on a per-lab basis to match the local timezone of the lab

The following snippets have no default template, and will be empty unless customized by the administrator:

Provides extra network configuration parameters for Anaconda.
Can be used to append extra packages to the %packages section of the kickstart.
system; <distro_major_version>
Can be used to insert extra Anaconda commands into the main section of the kickstart.
system_pre; <distro_major_version>_pre
Can be used to insert extra shell commands into the %pre section of the kickstart.
system_post; <distro_major_version>_post
Can be used to insert extra shell commands into the %post section of the kickstart.

Overriding kickstart snippets

When a snippet is included in a kickstart template, Beaker tries to load the snippet from the following locations on the server’s filesystem, in order:

  • /etc/beaker/snippets/per_system/snippet_name/system_fqdn
  • /etc/beaker/snippets/per_lab/snippet_name/labcontroller_fqdn
  • /etc/beaker/snippets/per_osversion/snippet_name/distro_version
  • /etc/beaker/snippets/per_osmajor/snippet_name/distro_major_version
  • /etc/beaker/snippets/snippet_name
  • /usr/lib/python2.6/site-packages/bkr/server/snippets/snippet_name

This allows administrators to customize Beaker kickstarts at whatever level is necessary.

For example, if the system needs to use a network interface other than the default, the following snippet could be placed in /etc/beaker/snippets/per_system/network/

network --device eth1 --bootproto dhcp --onboot yes

Writing kickstart templates

Kickstart templates and snippets are rendered using the same mechanism as custom kickstart templates from a recipe. Refer to Custom kickstart templates.

Some extra variables are also available to system templates (that is, templates loaded from disk rather than submitted by users):


The Beaker configuration. Call config.get(name, default=None) to look up values in Beaker’s application-wide configuration.


The recipe which is being provisioned. If the kickstart is for a system which is being manually provisioned (using the Provision tab on the system page) then this variable will be None.

This object has the following attributes:

Database identifier of the recipe.

The system which is being provisioned. This object has the following attributes:

The fully-qualified domain name of the system.
True if the system has EFI firmware. Only valid for x86.
A user object representing the system owner.

A user object representing the job owner. This object has the following attributes:

Full display name of the job owner.
Email address of the job owner.
Username of the job owner.