Using Image Composer (Image builder) with Foreman


Foreman does ship with an parameters which use “liveimg” kickstart statement to install OS from an existing image. This is used for Red Hat Virtualization node (or oVirt Hypervisor), but it is great workflow that can be used to provision generic nodes too. While we would like to focus on this sometimes in the future, there are few workarounds you need to do if you want to explore this kind of provisioning.

Terry from the RHEL team shared with me those workarounds, so I thought it would be great so share it with you in case you want to test it. Any feedback is welcome!

Add the following package groups and packages to the %packages section of /usr/share/lorax/composer/tar.ks. Note, that this might get overwritten in future versions. We need to request a bugfix to add these more permanently.



# cat RHEL_Minimal.toml
version = "0.0.10"
description = "A minimal image containing only @core"
groups = []
modules = []
name = "RHEL_Minimal"

version = "*"
name = "bash-completion"

version = "*"
name = "cockpit"

version = "*"
name = "cockpit-packagekit"

version = "*"
name = "insights-client"

version = "*"
name = "vim-enhanced"

hostname = "rhel-min-template"


enabled = ["ssh", "cockpit"]

enabled = ["sshd", "cockpit.socket"]

description = "ansible_admin"
groups = ["wheel"]
name = "admin"
key = "ssh-rsa AAAxxxxxxxxxxxxxxxx demo"
password = "$6$xxxxxx"


# This kickstart template will use the RHEL 8.4+ Boot DVD ISO
# to automation installation of a TAR OS image created by
# RHEL 8 Image Builder.

lang en_US
keyboard us
timezone America/New_York --isUtc
liveimg --url=""
clearpart --all --initlabel
#autopart --type=plain --fstype=xfs 
part /boot --fstype=xfs --size=1024 --asprimary
part pv.0 --fstype=lvmpv --ondisk=vda  --size=1 --grow  
volgroup system --pesize=4096 pv.0 
logvol / --vgname=system --name=root --fstype=xfs --percent=80
logvol /var --vgname=system --name=var --fstype=xfs --percent=10 --grow --maxsize=5000
logvol /var/log --vgname=system --name=varlog --fstype=xfs --percent=5 --grow --maxsize=5000
logvol swap  --vgname=system --name=swap --fstype="swap" --recommended
# firstboot --disable
network --bootproto=dhcp
auth --passalgo=sha512 --useshadow

# Configured in Blueprint instead
# selinux --enforcing

# Configure firewall & ervices in Blueprint instead
# firewall --enabled --http --ssh

user --name=testuser --groups=wheel --gecos="test user" --iscrypted --password="$6$xxxx"
sshkey --username=testuser "ssh-rsa AAAxxxxx demo"
#rootpw --iscrypted "$6$xxxxxx"
#sshkey --username=root "ssh-rsa AAAAxxxxx demo"

Have fun!