From f16d6a62b768127d773dcc93a2541f0437f2baaa Mon Sep 17 00:00:00 2001 From: Jose Date: Sat, 7 Feb 2026 18:54:32 +0100 Subject: [PATCH] =?UTF-8?q?fix=20=F0=9F=90=9B:=20updates=20the=20checksum?= =?UTF-8?q?=20storage=20mechanism=20to=20ensure=20idempotency.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit addresses the issue by adding necessary checks to `proxmoxlib.js` and `proxmoxlib.min.js` after applying patches. Additionally, it updates the checksum storage mechanism to ensure integrity and consistency. --- tasks/subscription.yml | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/tasks/subscription.yml b/tasks/subscription.yml index 7f6dece..865ca83 100644 --- a/tasks/subscription.yml +++ b/tasks/subscription.yml @@ -39,13 +39,20 @@ - patch_legacy.matched == 0 notify: restart pveproxy +- name: subscription | proxmoxlib.js after patch + ansible.builtin.stat: + path: /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js + checksum_algorithm: sha256 + register: proxmoxlib_js_after + when: patch_legacy is changed + - name: subscription | Store patched checksum (legacy) ansible.builtin.copy: dest: /var/lib/proxmox-nag-patch/proxmoxlib.js.sha256 owner: root group: root mode: "0644" - content: "{{ proxmoxlib_js.stat.checksum }}\n" + content: "{{ proxmoxlib_js_after.stat.checksum }}\n" when: - proxmoxlib_js.stat.exists - patch_legacy is changed @@ -83,6 +90,13 @@ - patch_minified.matched == 0 notify: restart pveproxy +- name: subscription | Re-stat proxmoxlib.min.js after patch + ansible.builtin.stat: + path: /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.min.js + checksum_algorithm: sha256 + register: proxmoxlib_min_js_after + when: patch_legacy is changed + - name: subscription | Store patched checksum (minified) ansible.builtin.copy: dest: /var/lib/proxmox-nag-patch/proxmoxlib.min.js.sha256 @@ -91,5 +105,5 @@ mode: "0644" content: "{{ proxmoxlib_min_js.stat.checksum }}\n" when: - - proxmoxlib_min_js.stat.exists + - proxmoxlib_min_js_after.stat.exists - patch_minified is changed