feat(pve_vm): add the pve_vm role #482
Notifications
Due Date
No due date set.
Blocks
#483 chore(release): 3.3.0
Mortis/Kamino
Reference: Mortis/Kamino#482
Reference in new issue
Block a user
Problem
The README Roadmap lists
pve_vmas the last role still to come. It manages the lifecycle of a Proxmox VE QEMU VM through the API: clone from a template, cloud-init settings (user, SSH keys, network), boot disk resize, drift detection and update of an existing VM, and destroy behind an explicit opt-in. No role in the Collection covers QEMU VMs yet.Proposal
Add a
pve_vmrole, shaped likepve_lxc.Decisions (maintainer, 2026-11-29):
Platform: the declared platforms are the guest OS, Ubuntu
nobleandresolute(roles/AGENTS.md), not the Proxmox node.Interface:
pve_vm_*inputs. Input checks go in a validate task file imported first withtags: always. There is no legacy-name guard.pve_vm_api_token_secrethas no default and is asserted non-empty when the lifecycle is managed.pve_vm_reboot_if_requiredis a real input (bool, defaulttrue) with an argument spec entry.Facts: only
pve_vm_existsis public. Every other fact and registered result, and the internal API auth header, carry the__pve_vm_prefix.pve_vm_api_hostdefaults to theansible_hostofpve_vm_nodefrom hostvars, aspve_lxcdoes. The README documents it and says to set it explicitly when the node is not in inventory.Credentials: the role never sets a cloud-init password (
cipassword). On a real run it deletes one stored on the VM, withno_log. Every task carrying a secret isno_log.Check mode:
proxmox_kvmandproxmox_diskhave no check-mode support.--checkpreviews through the role's own drift report and creation preview. The README says that a play-levelcheck_mode: trueis not supported.Testing: offline, no Proxmox API. The molecule scenario includes the role's task files directly, as the
pve_lxcscenario does:Verify asserts, statically over the role's task files, that no
community.proxmox.proxmox_kvmtask carriescipasswordand that the task deleting a storedcipasswordisno_log. The API lifecycle (clone, update, resize, destroy) is not exercised, and the README says so in one line.README in the roles layout. It covers:
Content stands alone: no host, group or inventory names, no issue references to other trackers, and no description of any particular environment, in the role, its README, comments or argument specs.
Acceptance criteria
roles/pve_vmexists withtasks/main.yml, a validate task file,defaults/main.yml,meta/main.yml(namespacemortis,min_ansible_version2.22, platforms Ubuntu noble and resolute),meta/argument_specs.ymlwith a matching default for every optional input, and a README in the roles layout.pve_vm_existsis a public fact;pve_vm_reboot_if_requiredhas defaulttrueand a spec entry; there is no legacy-name guard.cipassword; the stored-password delete and every secret-carrying task areno_log.roles/pve_vm/molecule/defaultruns validate (with refusal cases), seeded drift detection and, where the image allows, the cloud-init wait; verify holds the two staticcipasswordassertions; check runs before and after converge.#NNNreferences and IPv4 addresses returns only documentation addresses and generic examples; the command and result are in the PR.minor_changesfragment announces the role; the README Roadmap section is removed (this is its last role) and the lists of roles held are updated; the scenario has an entry in the molecule duration list.pve_vmscenario.Order
pve_vmrole with its molecule scenario, README, Roadmap removal, and aminor_changesfragment🤖 Generated with Claude Code