Files
werewulf/hpcod/ansible
ilkerandClaude Opus 5.5 772579648c hpcod: one binary installs, checks and tests the control plane
An installation used to be this one: the deploy scripts and the Ansible
defaults carried one site's domain, hypervisor and login, the Proxmox side
and the database were set up by hand, and deploying meant copying scripts
and a tree of roles beside the binary and keeping them in step with it.

The binary now carries the roles, the Terraform module, the schema and the
catalogue (embed.go), and installs itself:

- hpcod setup: a full-screen installer for administrators. It asks where
  clusters are built, signs in to Proxmox before asking anything else
  (root's password once, or tokens), offers nodes and datastores from what
  Proxmox has, checks every field as it is typed, runs every step with its
  output live, checks the result and offers a test cluster. -yes runs the
  same steps from a site file; make deploy uses that.
- hpcod verify: each fact checked by using it.
- hpcod selftest: the smallest real cluster, by the portal's own path, a
  job run on it, then taken down.
- Closed networks: hpcod serves HTTPS itself from a CA name-constrained to
  the site's domains, issuing and renewing its own certificate, and
  answers DNS for the portal and every cluster name.
- A simulated Proxmox: Proxmox VE in QEMU on the control plane host, on a
  private bridge with NAT, for trying it without one.

Every step reads back what it changed and is safe to run again. The
site's values live in one file; group_vars/all/site.yml is generated from
it, and the playbooks refuse to run without it. ci_user and -ssh-user no
longer default to a personal account. scripts/B10, B20 and C20 are gone:
their work is the setup steps.

Proven end to end on a simulated Proxmox (Proxmox VE 9 in a VM on a real
host): the install, the Proxmox step by the password path, the head
template, verify READY, and a test cluster that ran srun on its compute
node and was destroyed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 18:20:04 +01:00
..

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.