Packer templates for OpenSLX
Packer-based generation of reference systems using distro's ISOs.
Dependencies
Packer => 0.12.2
Download: https://www.packer.io/downloads.html
Usage
The file 'base.json' contains default variables (VM, SSH) common to all templates.
Thus it should always be included using packer's '-var-file' option.
Basic usage:
packer build -var-file=base.json
Example: build Ubuntu 16.04.2 LTS template using qemu builder
packer build -var-file=base.json -only=qemu ubuntu-16.04-amd64.json
Debug:
PACKER_LOG=1 PACKER_LOG_FILE=/var/log/packer.log \
packer build -debug -only=qemu -var-file=base.json ubuntu-16.04-amd64.json
Notes
Variables set in base.json can be overriden using packer's '-var' options, e.g.:
packer build -var-file=base.json -var='headless=true'
(Make sure you first include base.json before overriding a variable!)
Packer connects to the VM per SSH to provision them after the initial iso installation.
A default password is defined in base.json and the corresponding SHA-512 hashes are set
in the kickstart/preseed files. If you change the 'ssh_password' make sure to change the
hashes in the ks/ps files (generate with 'mkpasswd -m sha-512')!
The partitioning of the virtual disk is done via kickstart/preseed files. Currently,
a simple partition scheme is used: separate boot partition, rest a the main system
partition labeled as SLX_SYS, using ext4 as filesystem. Other filesystems are also
supported, tested were currently xfs and btrfs. If you change the filesystem to use
you need to adapt your boot configuration file (SLX_MOUNT_ROOT_OPTIONS).
While the qemu builder produces a qcow2 image, it can be further compressed using:
virt-sparsify --compress