1.3 KiB
CI runner VM: first-time setup
The runner VM is defined in 01-proxmox-infra. For the design, see decision 0002. Do this once, before the first deploy that creates the VM.
-
On the Ansible node, create a key that is used only for the runner VM:
ssh-keygen -t ed25519 -f ~/.ssh/runner_vm -C ansible-runner-vm -
Set the config from the repo root, then commit and push it in the private config repo:
cd 01-proxmox-infra pulumi config set --secret runnerIp <free IP outside the DHCP pool> pulumi config set --secret runnerAnsibleSshPublicKey "$(cat runner_vm.pub)" # copy of ~/.ssh/runner_vm.pub from the Ansible node -
Deploy
01-proxmox-infra. Pulumi creates the pfSense DHCP reservation and the VM. -
Check that the Ansible node can log in:
ssh -i ~/.ssh/runner_vm ubuntu@<runnerIp>. -
Install and register act_runner with the runner playbook in the Ansible repo. The playbook asks for a registration token: create one in Gitea, then reset it right after registering.
Revoke access
To lock the Ansible node out of the runner VM, remove its key from ~ubuntu/.ssh/authorized_keys on the VM. Changing the config alone isn't enough, because cloud-init only applies keys on the first boot.