Expand description
Each set-up step of a VM (Step) written once: as a root shell script for Linux, and as
PowerShell where Windows has the step. A VM backend only picks how the scripts reach the
machine (a Vagrant provisioner, cloud-init, remote-exec, WinRM), so every target sets a
machine up the same way.
Constants§
- CLOUD_
INIT_ WAIT - Waits for cloud-init to be done (its packages in,
aptfree): the first command of a set-up run over SSH on a VM cloud-init boots. Its failure doesn’t stop the set-up. - COMPOSE_
VERSION - The Compose plugin a Docker host gets, exactly (on hosts with
apt: Debian and Ubuntu). - DOCKER_
APT_ KEY_ SHA256 - Docker’s apt signing key, pinned by SHA-256 (the same armored key for Debian and Ubuntu,
download.docker.com/linux/<id>/gpg); verified against download.docker.com on 2026-10-16. - DOCKER_
VERSION - The Docker Engine a Docker host gets (
docker-vm,cloud-docker,hybrid), exactly: the version Isoloom’s Compose files are proven with, so two runs of one lab get the same engine. - INPUTS_
FILE - The inputs, uploaded before the steps run (
KEY=valuelines). - INSTALL_
DOCKER - Installs Docker, unless it is there, as a root script. On the apt family (Debian, Ubuntu) it
adds Docker’s own repository with the signing key pinned by SHA-256 (
DOCKER_APT_KEY_SHA256, nocurl | sh), then installs the engine atDOCKER_VERSION(the exact package resolved from the repository, so its epoch and build suffix are the repo’s) and the Compose plugin atCOMPOSE_VERSION. The RPM family (Rocky, AlmaLinux, CentOS, Fedora) still uses Docker’s own install script, pinned toDOCKER_VERSION. TODO(4.7): inline the dnf/RPM path too, its key pinned by SHA-256 (e6c650e0…), proven on a Rocky/Fedora guest. The apt branch fails closed (aset -esubshell, the key verified before use). - KEPT_
INPUTS_ FILE - Where the inputs are kept when a reboot comes (
/tmpis emptied at boot). - PROJECT_
ARCHIVE - The project’s archive, uploaded before the steps run.
- PROJECT_
DIR - Where the project is unpacked on a VM.
- PUBLISHED_
FROM_ OUTSIDE - On a Docker host VM, published ports reach containers whatever their routes: what arrives from
outside the VM (a forward to this computer, a client of the server’s address) is DNAT’ed by
Docker with its source kept, and a container of an
internet: falsenetwork, its default route removed, can’t answer it. Masquerading that traffic into the lab’s bridges makes it come from the bridge’s own address, which every container reaches. A unit keeps the rule across reboots, after Docker’s own. Run as root; running it again changes nothing.
Functions§
- linux
stepofmachineas a root shell script for a Linux VM;Nonewhen it has nothing to do there.- reboot_
check - After a reboot step: fails when the machine didn’t actually restart.
- record_
boot - Records this boot’s id, for
reboot_check: a transport that restarts the machine itself (Terraform’sremote-exec) runs it before restarting. - windows
stepofmachineas PowerShell for a Windows VM;Nonewhen Windows has no such step (or nothing to do for it).