feat(pve_lxc): add the pve_lxc role #389

Open
Claude wants to merge 1 commits from feat/386-pve-lxc-role into main
pull from: feat/386-pve-lxc-role
Owner

What and why

Closes #386

Adds pve_lxc: Proxmox VE LXC lifecycle through the API (community.proxmox), reconcile of raw lxc.* config, and an opt-in guest firewall file on the node. Keeps the pve_lxc_* interface. Declares Debian trixie as untested (until #226). The README Roadmap and the galaxy.yml description are updated.

Depends on #388 (community.proxmox/proxmoxer) and the ci image pin move that follows it. Lint and Molecule on this PR fail until both land; I'll rebase this PR then.

Decisions from #386, as applied:

  • No legacy-name guard. Internal facts carry a __ prefix.

  • Input checks in tasks/validate.yml, imported with tags: always and with their original conditions.

  • pve_lxc_api_token_secret has no default: it must be defined and non-empty whenever the lifecycle is managed.

  • The Molecule scenario covers only the parts that need no API:

    • the raw-config reconcile (byte for byte);
    • the firewall file;
    • backup cleanup;
    • 9 refusal cases;
    • the presence facts when the lifecycle is not managed.

    The API lifecycle is not exercised; the README says so.

For the maintainer: pve_lxc_cores, pve_lxc_swap and pve_lxc_nameserver are optional with no default; the role uses default(omit), as before. roles/AGENTS.md asks for a default value, so is this acceptable?

Verified

  • Two independent review rounds against the source role: the logic matches task by task, and the moved regexes match character for character. No case was found that now fails where the source role succeeds.
  • Commit and pre-push hooks: ansible-lint production, yamllint, REUSE, changelog lint, ansible-test sanity.
  • --syntax-check on prepare/converge/verify; ansible-doc -t role mortis.kamino.pve_lxc.
  • verify's refusal plays run locally against localhost: all 9 cases rescued on their intended message, with 0 failed.

Not verified

  • Molecule itself (CI only; the control host has no container runtime).
  • The API lifecycle paths (not covered, by decision).
  • Behaviour on trixie / real pmxcfs.

  • I confirm third-party material is recorded in NOTICE and REUSE.toml, or there is none.

Assisted-by: Claude Code:claude-opus-5-5

🤖 Generated with Claude Code

## What and why Closes #386 Adds `pve_lxc`: Proxmox VE LXC lifecycle through the API (`community.proxmox`), reconcile of raw `lxc.*` config, and an opt-in guest firewall file on the node. Keeps the `pve_lxc_*` interface. Declares Debian trixie as untested (until #226). The README Roadmap and the galaxy.yml description are updated. **Depends on #388** (community.proxmox/proxmoxer) and the ci image pin move that follows it. **Lint and Molecule on this PR fail until both land**; I'll rebase this PR then. Decisions from #386, as applied: - **No legacy-name guard.** Internal facts carry a `__` prefix. - **Input checks in `tasks/validate.yml`**, imported with `tags: always` and with their original conditions. - **`pve_lxc_api_token_secret` has no default**: it must be defined and non-empty whenever the lifecycle is managed. - **The Molecule scenario covers only the parts that need no API**: - the raw-config reconcile (byte for byte); - the firewall file; - backup cleanup; - 9 refusal cases; - the presence facts when the lifecycle is not managed. The API lifecycle is not exercised; the README says so. **For the maintainer:** `pve_lxc_cores`, `pve_lxc_swap` and `pve_lxc_nameserver` are optional with no default; the role uses `default(omit)`, as before. roles/AGENTS.md asks for a default value, so is this acceptable? ## Verified - Two independent review rounds against the source role: the logic matches task by task, and the moved regexes match character for character. No case was found that now fails where the source role succeeds. - Commit and pre-push hooks: ansible-lint production, yamllint, REUSE, changelog lint, ansible-test sanity. - `--syntax-check` on prepare/converge/verify; `ansible-doc -t role mortis.kamino.pve_lxc`. - verify's refusal plays run locally against localhost: all 9 cases rescued on their intended message, with 0 failed. ## Not verified - Molecule itself (CI only; the control host has no container runtime). - The API lifecycle paths (not covered, by decision). - Behaviour on trixie / real pmxcfs. --- - [x] I confirm third-party material is recorded in `NOTICE` and `REUSE.toml`, or there is none. Assisted-by: Claude Code:claude-opus-5-5 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Claude added the Kind/Feature label 2026-11-25 22:56:47 +00:00
Claude added 1 commit 2026-11-25 22:56:47 +00:00
feat(pve_lxc): add the pve_lxc role
Build / build (pull_request) Successful in 48s
Lint / lint (pull_request) Failing after 3m17s
Molecule / molecule (pull_request) Failing after 4m2s
318229bdb3
Add pve_lxc, which manages the lifecycle of a Proxmox VE LXC container
through the Proxmox API (community.proxmox), reconciles the raw lxc.*
lines of its config on the node and, opt-in, writes its guest firewall
file. It keeps the pve_lxc_* interface and carries no legacy-name guard.
The input asserts run from tasks/validate.yml before any change, and the
API token secret has no default.

The molecule scenario runs the validation and the node-side task files
against a container standing in for the node; the API lifecycle is not
exercised. Debian trixie is declared, untested.

Refs #386

Assisted-by: Claude Code:claude-opus-5-5
CODEOWNERS rules requested review from Defame1297 2026-11-25 22:56:47 +00:00
Some required checks failed
Build / build (pull_request) Successful in 48s
Required
Details
Lint / lint (pull_request) Failing after 3m17s
Required
Details
Molecule / molecule (pull_request) Failing after 4m2s
Required
Details
Some required checks were not successful.
This pull request has official review requests.
This pull request is blocked because it's outdated.
You are not authorized to merge this pull request.
This branch is out-of-date with the base branch
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin feat/386-pve-lxc-role:feat/386-pve-lxc-role
git checkout feat/386-pve-lxc-role
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mortis/Kamino#389