-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
proxmox_template: Add optional checksum validation #9601
base: main
Are you sure you want to change the base?
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution! I've added some first comments.
changelogs/fragments/9601-proxmox_template_support_for_checksums.yml
Outdated
Show resolved
Hide resolved
changelogs/fragments/9601-proxmox_template_support_for_checksums.yml
Outdated
Show resolved
Hide resolved
Thank you for the feedback! Sorry about the headache of all the re-formats, I'll be careful not to let those end up commited again. |
Alright, I think i fixed all the accidental refactorings to modules/proxmox.py, and properly added the function i needed to the module_utils/proxmox.py. Super sorry about the pull request that tried to change a completely unrelated file, I didn't even realize I had opened the wrong file. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple of comments
changelogs/fragments/9601-proxmox-template-support-for-checksums.yml
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the adjusments. I got another round of comments there.
All are very good points, I agree that having The The short answer on what the EditThe behavior of my changes are identical to the modules current behavior on a successful task. I added an explicit check for a task that exits and would normally appear successful to ansible, but on proxmox' end had failed with an error. This was to supplement the checksum verification function as it would return successfully even if it had failed the validation prior to the |
Fair enough, thanks for clarifying :-) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
changelogs/fragments/9601-proxmox-template-support-for-checksums.yml
Outdated
Show resolved
Hide resolved
Co-authored-by: Felix Fontein <[email protected]>
Thank you, completely forgot to change the documentation to specify its dependence on each other. |
SUMMARY
Adds options to enable and compare a downloaded file with a checksum to proxmox_template module.
While implementing this feature I required a function to check if an api request returned a non
OK
exit status.This felt best placed next to the
api_task_ok
function in proxmox.py.The implementation is an alteration of
fetch_template
that only gets called if the user requests the usage of checksum validation.Adds three new playbook options for proxmox_template:
verify_checksum
as a boolean valuechecksum
as a stringchecksum_algorithm
as a choice between 5 options:md5, sha224, sha256, sha348, sha512
Fixes #9553
ISSUE TYPE
COMPONENT NAME
proxmox_template
plugins/module_utils/proxmox
ADDITIONAL INFORMATION
I was having issues with either vscode or git refactoring the documentation lines as I was making commits.
Most of the changes made to those sections unrelated to new code are unintentional. I tried to repair those changes as best I could.