# Runbook: Provisioning a New Host Steps for adding a new machine to the infrastructure. ## NixOS host on Proxmox ```bash # 1. Use the PXE boot menu or installer ISO # The auto-installer at pxe-boot.sweet.home presents all flake targets. # 2. Add to nixos/ flake if a new build-type is needed # Otherwise pick the closest existing target (e.g. proxmox-minimal) # 3. Add SSH host key to clan vars (enables SOPS decryption) cd nixos ./scripts/sync-host-keys.sh # 4. Create the VM/LXC via Terraform cd ../terraform/proxmox # Add a resource block in the appropriate .tf file terraform plan terraform apply # 5. Deploy NixOS nixos-rebuild switch --flake ./nixos# --target-host ``` ## Non-NixOS host (Proxmox VM) ```bash # 1. Create VM in Proxmox (manually or via terraform) # 2. Add to ansible/inventory/hosts.yml with correct group # 3. Add SSH key, verify connectivity: ansible-playbook ansible/playbooks/ping.yml --limit # 4. Apply the role: ansible-playbook ansible/playbooks/.yml --limit --check --diff ansible-playbook ansible/playbooks/.yml --limit ``` ## Adding Ansible inventory entry ```yaml # ansible/inventory/hosts.yml — under the appropriate group: new-host.sweet.home: ansible_user: wayne # any role-specific variables ``` ## IPA enrollment (for any new host) ```bash # On the new host (after OS install): sudo ipa-client-install \ --server=domain-controller.sweet.home \ --domain=sweet.home \ --realm=SWEET.HOME \ --principal=admin \ --mkhomedir ```