[PR #9225/d71ba0fa backport][stable-10] Proxmox module refactoring #9634
+1,045
−630
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a backport of PR #9225 as merged into main (d71ba0f).
SUMMARY
This pull request refactors the historically grown
proxmox
module.The control flow was very opaque with some redundant checks and - most recently - features that were only introduced in parts of the module when they intended to target the whole module (see #9065).
This refactor aims to make the module more readable and more easily extendable.
Additionally, this request contains various bug fixes:
disk_volume
key is now properly parsed and passed on to the APIupdate=False
is now deprecated and will be changed toupdate=True
in version 11.0.0proxmox
utils module: The parameterchoose_first_if_multiple
ofget_vmid
is now used correctly, causing the function to return the first of multiple matches instead of failing.ISSUE TYPE
COMPONENT NAME
proxmox
ADDITIONAL INFORMATION
The following playbook should run correctly on both the old and refactored versions of this module, but the template creation will not be idempotent on the old version: