Server bootstrap: rules for contributors and agents
These rules add to the root AGENTS.md; read that first.
infra/ bootstraps Linux servers for the Datacenter profile (ADR-0012).
Macs and personal Linux machines don’t use Ansible. They install the einsora binary and run einsora up or
einsora agent (Phases 1–2).
Layout
Section titled “Layout”ansible/site.yml entry point: base → iommu → wireguard → k3sansible/inventory/ hosts.example.yml is committed; hosts.yml (real IPs) is gitignoredansible/group_vars/all/ main.yml (non-secret); vault.yml (ansible-vault encrypted, gitignored)ansible/roles/<role>/ tasks/, handlers/, templates/, defaults/scripts/ read-only diagnostics to run on a node (IOMMU groups, GPU inventory)- Never run playbooks against real hosts. Agents may run
ansible-lint,ansible-playbook --syntax-check, and, if asked,--check --diff. Applying changes is for humans. - Idempotent tasks only. Every task must be safe to re-run. Use
creates:,changed_when:, or proper modules rather than bareshell. - Reboots are opt-in. Kernel cmdline changes notify a handler that reboots only if
iommu_allow_reboot: true. - Secrets (k3s token, WireGuard private keys) live only in
group_vars/all/vault.yml, encrypted withansible-vault. Reference them asvault_*variables. - Use fully qualified module names (
ansible.builtin.apt, notapt). - Scripts in
scripts/are diagnostics only: read-only,set -euo pipefail, and they must pass shellcheck. - Keep k3s flags in sync with deploy/: Cilium needs flannel, network policy, and kube-proxy disabled, and MetalLB needs servicelb disabled.
- One inventory per region (ADR-0009). Never mix regions’ hosts in one inventory, because each region is its own cluster with its own network ranges.
- CPU worker nodes (ADR-0010) and control-plane CPU servers use
base,wireguard, andk3s, but notiommu. Put them in a separate group (planned:cpu_nodes). - The fleet runs on UTC, so logs and usage-accounting events line up across regions.
Commands
Section titled “Commands”cd infra/ansibleuvx --from ansible-core ansible-playbook --syntax-check -i inventory/hosts.example.yml site.ymluvx ansible-lintshellcheck ../scripts/*.sh