Files
swarm-master/ansible/playbooks/provision-vm.yml
William Valentin ea5e2c2ef3 Add orb and sun VMs with virtiofs swarm-common share
- Add orb (192.168.122.183) and sun (192.168.122.184) to inventory
- Create host_vars for orb and sun (fresh install, brew_packages: [])
- Add brew_packages to zap host_vars (gogcli, himalaya, kubernetes-cli, opencode)
- customize.yml: parameterize brew_packages via host_vars, add /mnt/swarm-common
  virtiofs+bindfs mount for all VMs, install bindfs, fix Homebrew install
- provision-vm.yml: remove become requirement; use virsh vol commands for all
  disk/image operations (no sudo needed)
- roles/vm/tasks/main.yml: rewrite disk provisioning to use virsh vol-create-as
  and vol-upload; fix vol name quoting for names with spaces; use qcow2 backing
- domain.xml.j2: always include swarm-common virtiofs share; make main share
  conditional on vm_virtiofs_source/tag

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-13 11:06:08 -07:00

31 lines
992 B
YAML

---
# Provision a new OpenClaw VM from scratch on the hypervisor host.
#
# This playbook runs on localhost (the hypervisor) and:
# 1. Downloads the Ubuntu cloud image (cached)
# 2. Creates the VM disk image
# 3. Builds a cloud-init seed ISO for first-boot configuration
# 4. Defines the VM XML (EFI, memfd, virtiofs, TPM, watchdog)
# 5. Configures a static DHCP reservation
# 6. Enables autostart and starts the VM
# 7. Waits for SSH
#
# After this playbook completes, run:
# ansible-playbook -i inventory.yml playbooks/install.yml --limit <instance>
# ansible-playbook -i inventory.yml playbooks/customize.yml --limit <instance>
# ~/lab/swarm/restore-openclaw-vm.sh <instance> # to restore config from backup
#
# Usage:
# ansible-playbook -i inventory.yml playbooks/provision-vm.yml --limit zap
- name: Provision OpenClaw VM
hosts: openclaw_servers
connection: local
become: false
vars:
ansible_python_interpreter: /usr/bin/python3
roles:
- vm