[PR #9601/b9299e63 backport][stable-10] proxmox_template: Add optional checksum validation (#9624)

proxmox_template: Add optional checksum validation (#9601)

* Adds support for checksums in Proxmox_template.

* Implemented checksum verification

* Removed unintended captilization changes

* further fixing of unintended changes

* removed misspelling

* Final adjustementsto proxmox_template.py

* fixed typo

* fixed a typo in sha512

* add changelog fragment

* fixed type in choices for checksum_algortihm

* fixed file naming error and add relevant links to changelog

* Fix all unintentional refactorings

* refactoring changes removed

* renamed the function verify_checksum to fetch_and_verify for clarity

* Adjusted additions based on feedback

* Apply suggestions from code review

Co-authored-by: Felix Fontein <felix@fontein.de>

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit b9299e633c)

Co-authored-by: Andrew Bowen <andrewb12505@gmail.com>
This commit is contained in:
patchback[bot] 2025-01-25 10:32:43 +01:00 committed by GitHub
parent 4b410c5007
commit cc49336090
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 64 additions and 3 deletions

View file

@ -170,6 +170,15 @@ class ProxmoxAnsible(object):
except Exception as e:
self.module.fail_json(msg='Unable to retrieve API task ID from node %s: %s' % (node, e))
def api_task_failed(self, node, taskid):
""" Explicitly check if the task stops but exits with a failed status
"""
try:
status = self.proxmox_api.nodes(node).tasks(taskid).status.get()
return status['status'] == 'stopped' and status['exitstatus'] != 'OK'
except Exception as e:
self.module.fail_json(msg='Unable to retrieve API task ID from node %s: %s' % (node, e))
def api_task_complete(self, node_name, task_id, timeout):
"""Wait until the task stops or times out.