This repository helps to capture my current workstation configuration and automate the setup and update process using the Salt configuration management framework.
Configuration changes that are managed by Salt can be applied by running
./dotfiles apply
, this is usually the case for configuration referenced in
sls files. The other configuration not managed under Salt occurs in a
separate build process that is part of the initial Gentoo installation.
The build command creates a Gentoo machine image using Packer.
Install Packer on Gentoo which currently requires accept keywords changes, you can add these as shown below:
# The HCL2 template files require a Packer version of at least 1.6.1.
mkdir --parents /etc/portage/package.accept_keywords/dev-util
echo ~dev-util/packer-1.7.2 > /etc/portage/package.accept_keywords/dev-util/packer
# Install Packer
emerge dev-util/packer
Packer also provides additional install options.
The configuration uses the Packer builder for QEMU:
# Install QEMU
emerge app-emulation/qemu
Now run the build command:
./dotfiles build
This starts a staged build process that will create a Gentoo base system and then reboot into that Gentoo base system to install and configure the packages and copy the dotfiles.
Here's an overview of the process:
Starting with the gentoo/gentoo-autobuild-vars
script the latest Gentoo
minimal install ISO is downloaded and used as the boot medium for Packer.
Packer will provision the base system using gentoo/gentoo.pkr.hcl along with the
scripts under gentoo. This will create the VM image build/gentoo-iso.
Next, the salt state is prepared using salt/salt-top
. Packer then
boots the VM image build/gentoo-iso and using salt/salt.pkr.hcl Packer will
install and run Salt using the script salt/salt-apply
. This will create the
VM image build/gentoo-salt.