Files
Kamino/roles/pve_lxc/molecule/default/tasks/failed_run.yml
T
Defame1297 318229bdb3
Build / build (pull_request) Successful in 48s
Lint / lint (pull_request) Failing after 3m17s
Molecule / molecule (pull_request) Failing after 4m2s
feat(pve_lxc): add the pve_lxc role
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
2026-11-25 22:55:25 +00:00

23 lines
1.1 KiB
YAML

---
# One failing run: includes the role's task file named by the case, with the inputs the caller
# sets on the include, and asserts that the expected message, not something else, stopped it.
# Input: pve_lxc_test_case (name, tasks_from, expect).
- name: "Run the role, case {{ pve_lxc_test_case.name }}"
block:
- name: "Include the role, case {{ pve_lxc_test_case.name }}"
ansible.builtin.include_role:
name: mortis.kamino.pve_lxc
tasks_from: "{{ pve_lxc_test_case.tasks_from }}"
# Only reached when the include returned. The message must not contain the expected
# text, so the rescue below cannot mistake it for the failure under test.
- name: "Fail because the include returned, case {{ pve_lxc_test_case.name }}"
ansible.builtin.fail:
msg: The role accepted the input
rescue:
- name: "The expected failure stopped the run, case {{ pve_lxc_test_case.name }}"
ansible.builtin.assert:
that: pve_lxc_test_case.expect in (ansible_failed_result.msg | default(''))
fail_msg: "Expected '{{ pve_lxc_test_case.expect }}', got: {{ ansible_failed_result.msg | default('') }}"
quiet: true