This refactoring updates the usage of `stat` modules in our Ansible playbooks to utilize the `ansible.builtin.stat` module. This change ensures consistency and potentially improves compatibility with newer versions of Ansible.
35 lines
1.2 KiB
YAML
35 lines
1.2 KiB
YAML
---
|
|
- name: subscription | Check for legacy proxmoxlib.js
|
|
ansible.builtin.stat:
|
|
path: /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js
|
|
register: proxmoxlib_js
|
|
|
|
- name: subscription | Remove subscription nag (legacy proxmoxlib.js)
|
|
ansible.builtin.replace:
|
|
path: /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js
|
|
regexp: "if \\(data.status !== 'Active'\\)"
|
|
replace: "if (false)"
|
|
when: proxmoxlib_js.stat.exists
|
|
register: patch_legacy
|
|
failed_when:
|
|
- proxmoxlib_js.stat.exists
|
|
- patch_legacy.matched == 0
|
|
notify: restart pveproxy
|
|
|
|
- name: subscription | Check for minified proxmoxlib.min.js (VE 8/9)
|
|
ansible.builtin.stat:
|
|
path: /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.min.js
|
|
register: proxmoxlib_min_js
|
|
|
|
- name: subscription | Remove subscription nag (minified bundle for VE 8/9)
|
|
ansible.builtin.replace:
|
|
path: /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.min.js
|
|
regexp: "data.status!=='Active'"
|
|
replace: "false"
|
|
when: proxmoxlib_min_js.stat.exists
|
|
register: patch_minified
|
|
failed_when:
|
|
- proxmoxlib_min_js.stat.exists
|
|
- patch_minified.matched == 0
|
|
notify: restart pveproxy
|