The working rules come first because they are what the rest of this commit
came out of. Every expensive mistake in this work had one shape: an action
reported success, had not changed anything, and a measurement was built on
top of it. A sed whose pattern did not match. A str.replace guarded by an
assertion that only checked the value was absent beforehand. A wwctl image
import that refused an existing name, so a full boot measurement ran against
the old image and 234s was reported as real. A pgrep completion check that
matched its own shell and could never report completion. The rule is to read
the changed state back rather than trust an exit code, and to assert what a
measurement depends on before measuring.
Profiling a cold provision - which needed a fix of its own, since the
first-boot runner started ansible-playbook from / and so never loaded
ansible.cfg at all, quietly using stock defaults for the tmp paths that file
exists to set - showed one task dominating: 33.6s of the 80s went to
"Install epel-release", which installs nothing. The template already has it.
The time was dnf rebuilding the metadata cache that the template build
deletes on its way out; the same task against a warm cache takes 2.7s.
Keeping the cache would have been the smaller fix and the wrong one: the
saving decays as the template ages and dnf expires the metadata anyway. The
first-boot path now skips install-tagged tasks outright. They put software
on disk, this only ever runs on a clone of a template that has it, and
skipping them also takes EPEL and OpenHPC back out of the provisioning path
- an outage at either meant no tenant could be created at all. The control
plane still runs the full playbook for day-2 work.
The template cleanup now also removes /root/.docker/config.json. With the
image inherited rather than pulled, no tenant needs the registry credential,
and leaving it there shipped one - narrow, read-only, but real - into every
tenant ever cloned. A control-plane run that does need to pull writes it
again from the environment.
Task profiling is on permanently. A provision getting slower is the failure
mode here, and without per-task timings the only way to find out where the
time went is to instrument it again afterwards, on a cluster that has since
been destroyed.
Not yet measured: the expected drop from 80s. Last verified provision was
178s total - terraform 32s, configuration 80s, node PXE 66s.