Initial commit — OpenClaw VM infrastructure
- ansible/: VM provisioning playbooks and roles - provision-vm.yml: create KVM VM from Ubuntu cloud image - install.yml: install OpenClaw on guest (upstream) - customize.yml: swappiness, virtiofs fstab, linger - roles/vm/: libvirt domain XML, cloud-init templates - inventory.yml + host_vars/zap.yml: zap instance config - backup-openclaw-vm.sh: daily rsync + MinIO upload - restore-openclaw-vm.sh: full redeploy from scratch - README.md: full operational documentation Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
47
ansible/playbooks/customize.yml
Normal file
47
ansible/playbooks/customize.yml
Normal file
@@ -0,0 +1,47 @@
|
||||
---
|
||||
# Post-provisioning customizations for OpenClaw VMs
|
||||
# Run after playbooks/install.yml to apply host-specific tweaks
|
||||
#
|
||||
# Usage:
|
||||
# ansible-playbook -i inventory.yml playbooks/customize.yml
|
||||
# ansible-playbook -i inventory.yml playbooks/customize.yml --limit zap
|
||||
|
||||
- name: OpenClaw VM customizations
|
||||
hosts: openclaw_servers
|
||||
become: true
|
||||
|
||||
tasks:
|
||||
|
||||
- name: Set vm.swappiness=10 (live)
|
||||
ansible.posix.sysctl:
|
||||
name: vm.swappiness
|
||||
value: "10"
|
||||
state: present
|
||||
reload: true
|
||||
|
||||
- name: Persist vm.swappiness in /etc/sysctl.conf
|
||||
ansible.builtin.lineinfile:
|
||||
path: /etc/sysctl.conf
|
||||
regexp: '^vm\.swappiness'
|
||||
line: 'vm.swappiness=10'
|
||||
state: present
|
||||
|
||||
- name: Create virtiofs mount point
|
||||
ansible.builtin.file:
|
||||
path: /mnt/swarm
|
||||
state: directory
|
||||
mode: "0755"
|
||||
|
||||
- name: Mount virtiofs swarm share via fstab
|
||||
ansible.posix.mount:
|
||||
path: /mnt/swarm
|
||||
src: swarm
|
||||
fstype: virtiofs
|
||||
opts: defaults
|
||||
state: present
|
||||
# Note: actual mount requires reboot after VM config update
|
||||
|
||||
- name: Ensure openclaw user lingering is enabled (for user systemd services)
|
||||
ansible.builtin.command:
|
||||
cmd: loginctl enable-linger openclaw
|
||||
changed_when: false
|
||||
Reference in New Issue
Block a user