fix 🐛: updates the checksum storage mechanism to ensure idempotency.
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.
This commit is contained in:
@@ -39,13 +39,20 @@
|
|||||||
- patch_legacy.matched == 0
|
- patch_legacy.matched == 0
|
||||||
notify: restart pveproxy
|
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)
|
- name: subscription | Store patched checksum (legacy)
|
||||||
ansible.builtin.copy:
|
ansible.builtin.copy:
|
||||||
dest: /var/lib/proxmox-nag-patch/proxmoxlib.js.sha256
|
dest: /var/lib/proxmox-nag-patch/proxmoxlib.js.sha256
|
||||||
owner: root
|
owner: root
|
||||||
group: root
|
group: root
|
||||||
mode: "0644"
|
mode: "0644"
|
||||||
content: "{{ proxmoxlib_js.stat.checksum }}\n"
|
content: "{{ proxmoxlib_js_after.stat.checksum }}\n"
|
||||||
when:
|
when:
|
||||||
- proxmoxlib_js.stat.exists
|
- proxmoxlib_js.stat.exists
|
||||||
- patch_legacy is changed
|
- patch_legacy is changed
|
||||||
@@ -83,6 +90,13 @@
|
|||||||
- patch_minified.matched == 0
|
- patch_minified.matched == 0
|
||||||
notify: restart pveproxy
|
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)
|
- name: subscription | Store patched checksum (minified)
|
||||||
ansible.builtin.copy:
|
ansible.builtin.copy:
|
||||||
dest: /var/lib/proxmox-nag-patch/proxmoxlib.min.js.sha256
|
dest: /var/lib/proxmox-nag-patch/proxmoxlib.min.js.sha256
|
||||||
@@ -91,5 +105,5 @@
|
|||||||
mode: "0644"
|
mode: "0644"
|
||||||
content: "{{ proxmoxlib_min_js.stat.checksum }}\n"
|
content: "{{ proxmoxlib_min_js.stat.checksum }}\n"
|
||||||
when:
|
when:
|
||||||
- proxmoxlib_min_js.stat.exists
|
- proxmoxlib_min_js_after.stat.exists
|
||||||
- patch_minified is changed
|
- patch_minified is changed
|
||||||
|
|||||||
Reference in New Issue
Block a user