feat(pve_lxc): add the pve_lxc role #389

Merged
Defame1297 merged 2 commits from feat/386-pve-lxc-role into main 2026-11-25 23:41:17 +00:00
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
Defame1297 added 1 commit 2026-11-25 23:39:17 +00:00
Merge branch 'main' into feat/386-pve-lxc-role
Build / build (pull_request) Successful in 28s
Molecule / molecule (pull_request) Successful in 1m5s
Lint / lint (pull_request) Successful in 1m53s
02d6f9a83e
Defame1297 scheduled this pull request to auto merge when all checks succeed 2026-11-25 23:40:27 +00:00
Defame1297 approved these changes 2026-11-25 23:40:36 +00:00
Defame1297 merged commit 7f05d067c8 into main 2026-11-25 23:41:17 +00:00
Defame1297 deleted branch feat/386-pve-lxc-role 2026-11-25 23:41:19 +00:00
Sign in to join this conversation.
No Reviewers
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mortis/Kamino#389