Files
werewulf/hpcod/ansible/README.md
T
ilker 01e98547e3 hpcod phase 4: Ansible roles, and move provisioning to the control plane host
Roles ported from scripts/: common, warewulf, node_image, warewulf_nodes,
slurm and verify, driven by an inventory generated from the Terraform outputs.
The comments explaining why came across deliberately - each records a failure
that cost real time to find, and porting them without the reasoning would
guarantee rediscovering all of it.

Role order is not arbitrary: slurm runs before warewulf_nodes because the hpc
overlay it creates has to exist before the final overlay build. Reversed, the
nodes boot without slurm.conf or the MUNGE key and cannot join.

node_image can copy an already-built image from another head node instead of
building one, which turns twelve minutes of dnf into about two. The copy runs
from the source host so the image never travels via the controller. Where a
shared image store should really live is left open; nothing above the role
depends on the answer.

Terraform and Ansible now live on the control plane host at /var/lib/hpcod,
alongside the portal, which reaches every Proxmox API and every tenant head
node directly. Provisioning is a control plane component, not something an
operator runs from a laptop. Ansible's scratch directory is pinned in
ansible.cfg because the service account has no home.

MAC namespace fixed. Tenants now use BC:24:11:E1:<tenant>:<index>. The
hand-built cluster on this hypervisor already occupies BC:24:11:E0 with 00 and
0A in the next byte, so a tenant with id 10 would have emitted a duplicate MAC
onto the same L2 segment and broken the running cluster. tenant_id is now
bounded at 254 since it is a MAC byte and a subnet octet.

The roles are written, lint-clean and syntax-checked, but have not yet been
run against a real tenant.
2026-09-01 14:47:32 +02:00

2.6 KiB
Raw Permalink Blame History

Ansible — tenant configuration

Phase 4: turns the VMs Terraform created into a working HPC cluster. These roles are ports of scripts/, which were verified by hand first — the comments explaining why came with them deliberately, because each one records a failure that cost real time to find.

Where this runs

On the provisioning host, not on a laptop. Both trees are deployed to /var/lib/hpcod/ on the same machine as the portal, which reaches every Proxmox API and every tenant head node directly — no tunnels, no operator workstation in the path. That is also what the design calls for: the provisioner is a component of the control plane, not something a human runs by hand.

ssh web-frontend
cd /var/lib/hpcod/terraform/envs/lab && sudo -u hpcod tofu apply
cd /var/lib/hpcod/ansible          && sudo -u hpcod ansible-playbook -i inventory/tenant.yml site.yml

# once the compute nodes are powered on and have had time to PXE boot
sudo -u hpcod ansible-playbook -i inventory/tenant.yml site.yml --tags cluster

Ansible's scratch directory is set in ansible.cfg because the service account has no home; without it Ansible dies at startup trying to create ~/.ansible/tmp.

Role order is not arbitrary

slurm runs before warewulf_nodes because the hpc overlay it creates has to exist before the final overlay build. Reverse them and the nodes boot without slurm.conf or the MUNGE key, and come up unable to join.

What the comments are protecting

Role Trap
warewulf cloud-init's forced-command wrapper in root's authorized_keys gets copied to every node and locks root out of all of them
warewulf_nodes --netdev must be the node's real interface name; "default" matches nothing and the node never leaves its DHCP lease
warewulf_nodes profile set --nettagadd returns 0, prints nothing, and changes nothing — nodes then boot with an empty resolv.conf
node_image slurmd's spool directory is runtime state, so it belongs in the image, not an overlay
slurm overlay import -p creates parents 0500 root:root, which locks /etc and stops munged
slurm OpenHPC ships no lmod-defaults for this compiler pairing, so the default modulefile is written by hand or every MPI binary fails on libucp.so.0
slurm RealMemory is set below the VM's actual memory because the rootfs lives in RAM

Not covered yet

Identity. A10–A60 stand up FreeIPA and enrol the stateless nodes with per-node keytabs; porting that is the next piece. Until then a tenant gets local accounts only.