Add one Ansible control node that can run playbooks across all three Proxmox hosts, the k3s VMs and the Docker LXC.
Recommendation: a dedicated unprivileged LXC
Ansible only needs Python and outbound SSH, so it needs very little compute. The deciding factor is what still works when the thing being fixed is down. The control node should depend on as little of the managed estate as possible.
Dedicated LXC
Docker container
Kubernetes pod
Still works when k3s is down
Yes
Yes
No
Still works when the Docker LXC is down
Yes
No
Yes
Can patch or reboot the k3s nodes safely
Yes
Yes
No, it can evict or kill itself
Can patch the Docker host safely
Yes
No, it runs on that host
Yes
Layers below it
Proxmox
Proxmox, LXC, Docker
Proxmox, VM, k3s, Longhorn/networking
Persistent SSH keys, facts, collections
Simple
Needs volumes
Needs PVC and Secrets
Reproducible environment
Good, with a pinned venv
Best
Best
Why not Kubernetes: the most valuable playbooks are the ones that upgrade, drain and reboot k3s nodes, and recover the cluster. A controller inside the cluster is unavailable in exactly those situations. A Kubernetes Job could still suit routine scheduled tasks later, but it should not be the primary controller.
Why not Docker: it is workable, but it adds two layers and makes the Docker LXC a dependency. A container image is still a good option later for pinning the Ansible version, for example as a CI execution environment.
Constraints from this repo
The Proxmox hosts are standalone.01-proxmox-infra has a separate provider and endpoint for pve-b550, pve-optiplex and pve-esprimo. The LXC therefore lives on one host, with no HA or migration. A playbook must not reboot that host from inside the LXC.
Two hosts share the node name pve. The inventory must use the unique host labels above, not Proxmox node names.
Do not reuse ciRunnerPrivateKey. Ansible gets its own SSH key, so it can be rotated or revoked without affecting CI bootstrap.
Never recreate VMs to roll this out. Changing cloud-init key configuration on the existing VM resources could trigger replacement. Add the new key to running VMs with separate manual steps, and check that pulumi preview shows no VM update or replacement.
Secrets stay out of git. Use Ansible Vault or another approved store, and keep the vault password outside the repo.
Proposed scope
Define the LXC in 01-proxmox-infra: unprivileged, Debian or Ubuntu LTS, about 1 vCPU, 1 GB RAM, 8 GB disk, static IP
Confirm pulumi preview only adds resources and leaves all VMs unchanged
Install Ansible in a pinned Python venv, with collections pinned in requirements.yml
Add an ansible/ directory with ansible.cfg, inventory, group vars and playbooks
Create a dedicated ansible user and SSH key on managed hosts, with documented manual steps for existing machines
Add a read-only first playbook: ansible all -m ping plus a fact or uptime report
Add a rolling-update playbook with serial: 1 that drains and uncordons k3s nodes one at a time
Document setup and recovery in docs/runbooks/
Include the LXC in Proxmox backups, and confirm it can be rebuilt from git
Rolling-reboot safety
The k3s playbook must wait for each node and for Longhorn volumes to become healthy before moving on. Draining does not evict DaemonSets, so it must not assume a kube-vip VIP has moved just because a node was drained.
Decisions needed
Which Proxmox host should run the LXC? It should be the host that is least often rebooted, and that host's own updates need a separate procedure.
Should Ansible connect to Proxmox hosts as a dedicated sudo user (recommended) or as root?
Should playbooks live in this repo (recommended, under ansible/) or in a separate repo?
Should playbooks run manually only at first (recommended), or also from Gitea Actions?
Acceptance criteria
ansible all -m ping succeeds for all three Proxmox hosts, all six k3s VMs and the Docker LXC
The control node still works with k3s and the Docker LXC stopped or unavailable
A check-mode run of the update playbook reports its planned changes without modifying any host
No existing VM is replaced or recreated
## Goal
Add one Ansible control node that can run playbooks across all three Proxmox hosts, the k3s VMs and the Docker LXC.
## Recommendation: a dedicated unprivileged LXC
Ansible only needs Python and outbound SSH, so it needs very little compute. The deciding factor is **what still works when the thing being fixed is down**. The control node should depend on as little of the managed estate as possible.
| | Dedicated LXC | Docker container | Kubernetes pod |
|---|---|---|---|
| Still works when k3s is down | Yes | Yes | **No** |
| Still works when the Docker LXC is down | Yes | **No** | Yes |
| Can patch or reboot the k3s nodes safely | Yes | Yes | **No, it can evict or kill itself** |
| Can patch the Docker host safely | Yes | **No, it runs on that host** | Yes |
| Layers below it | Proxmox | Proxmox, LXC, Docker | Proxmox, VM, k3s, Longhorn/networking |
| Persistent SSH keys, facts, collections | Simple | Needs volumes | Needs PVC and Secrets |
| Reproducible environment | Good, with a pinned venv | Best | Best |
**Why not Kubernetes:** the most valuable playbooks are the ones that upgrade, drain and reboot k3s nodes, and recover the cluster. A controller inside the cluster is unavailable in exactly those situations. A Kubernetes `Job` could still suit routine scheduled tasks later, but it should not be the primary controller.
**Why not Docker:** it is workable, but it adds two layers and makes the Docker LXC a dependency. A container image is still a good option later for pinning the Ansible version, for example as a CI execution environment.
## Constraints from this repo
- **The Proxmox hosts are standalone.** `01-proxmox-infra` has a separate provider and endpoint for `pve-b550`, `pve-optiplex` and `pve-esprimo`. The LXC therefore lives on one host, with no HA or migration. A playbook must not reboot that host from inside the LXC.
- **Two hosts share the node name `pve`.** The inventory must use the unique host labels above, not Proxmox node names.
- **Do not reuse `ciRunnerPrivateKey`.** Ansible gets its own SSH key, so it can be rotated or revoked without affecting CI bootstrap.
- **Never recreate VMs to roll this out.** Changing cloud-init key configuration on the existing VM resources could trigger replacement. Add the new key to running VMs with separate manual steps, and check that `pulumi preview` shows no VM update or replacement.
- **Secrets stay out of git.** Use Ansible Vault or another approved store, and keep the vault password outside the repo.
## Proposed scope
- [ ] Define the LXC in `01-proxmox-infra`: unprivileged, Debian or Ubuntu LTS, about 1 vCPU, 1 GB RAM, 8 GB disk, static IP
- [ ] Confirm `pulumi preview` only adds resources and leaves all VMs unchanged
- [ ] Install Ansible in a pinned Python venv, with collections pinned in `requirements.yml`
- [ ] Add an `ansible/` directory with `ansible.cfg`, inventory, group vars and playbooks
- [ ] Create a dedicated `ansible` user and SSH key on managed hosts, with documented manual steps for existing machines
- [ ] Add a read-only first playbook: `ansible all -m ping` plus a fact or uptime report
- [ ] Add a rolling-update playbook with `serial: 1` that drains and uncordons k3s nodes one at a time
- [ ] Document setup and recovery in `docs/runbooks/`
- [ ] Include the LXC in Proxmox backups, and confirm it can be rebuilt from git
## Rolling-reboot safety
The k3s playbook must wait for each node and for Longhorn volumes to become healthy before moving on. Draining does not evict DaemonSets, so it must not assume a kube-vip VIP has moved just because a node was drained.
## Decisions needed
1. Which Proxmox host should run the LXC? It should be the host that is least often rebooted, and that host's own updates need a separate procedure.
2. Should Ansible connect to Proxmox hosts as a dedicated sudo user (recommended) or as `root`?
3. Should playbooks live in this repo (recommended, under `ansible/`) or in a separate repo?
4. Should playbooks run manually only at first (recommended), or also from Gitea Actions?
## Acceptance criteria
- `ansible all -m ping` succeeds for all three Proxmox hosts, all six k3s VMs and the Docker LXC
- The control node still works with k3s and the Docker LXC stopped or unavailable
- A check-mode run of the update playbook reports its planned changes without modifying any host
- No existing VM is replaced or recreated
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Goal
Add one Ansible control node that can run playbooks across all three Proxmox hosts, the k3s VMs and the Docker LXC.
Recommendation: a dedicated unprivileged LXC
Ansible only needs Python and outbound SSH, so it needs very little compute. The deciding factor is what still works when the thing being fixed is down. The control node should depend on as little of the managed estate as possible.
Why not Kubernetes: the most valuable playbooks are the ones that upgrade, drain and reboot k3s nodes, and recover the cluster. A controller inside the cluster is unavailable in exactly those situations. A Kubernetes
Jobcould still suit routine scheduled tasks later, but it should not be the primary controller.Why not Docker: it is workable, but it adds two layers and makes the Docker LXC a dependency. A container image is still a good option later for pinning the Ansible version, for example as a CI execution environment.
Constraints from this repo
01-proxmox-infrahas a separate provider and endpoint forpve-b550,pve-optiplexandpve-esprimo. The LXC therefore lives on one host, with no HA or migration. A playbook must not reboot that host from inside the LXC.pve. The inventory must use the unique host labels above, not Proxmox node names.ciRunnerPrivateKey. Ansible gets its own SSH key, so it can be rotated or revoked without affecting CI bootstrap.pulumi previewshows no VM update or replacement.Proposed scope
01-proxmox-infra: unprivileged, Debian or Ubuntu LTS, about 1 vCPU, 1 GB RAM, 8 GB disk, static IPpulumi previewonly adds resources and leaves all VMs unchangedrequirements.ymlansible/directory withansible.cfg, inventory, group vars and playbooksansibleuser and SSH key on managed hosts, with documented manual steps for existing machinesansible all -m pingplus a fact or uptime reportserial: 1that drains and uncordons k3s nodes one at a timedocs/runbooks/Rolling-reboot safety
The k3s playbook must wait for each node and for Longhorn volumes to become healthy before moving on. Draining does not evict DaemonSets, so it must not assume a kube-vip VIP has moved just because a node was drained.
Decisions needed
root?ansible/) or in a separate repo?Acceptance criteria
ansible all -m pingsucceeds for all three Proxmox hosts, all six k3s VMs and the Docker LXC