All checks were successful
ansible-lint / Ansible Lint (push) Successful in 12s
Gitleaks Scan / gitleaks (push) Successful in 5s
ai-reviews / Review PR (pull_request) Successful in 27s
Markdown Lint / markdown-lint (push) Successful in 5s
ansible-lint / Ansible Lint (pull_request) Successful in 11s
Gitleaks Scan / gitleaks (pull_request) Successful in 4s
Markdown Lint / markdown-lint (pull_request) Successful in 5s
Corrected a typographical error in the task name to ensure accurate documentation and clarity.
76 lines
2.2 KiB
YAML
76 lines
2.2 KiB
YAML
---
|
|
# ansible_role_proxmox_provision/handlers/main.yml
|
|
# Handlers for role
|
|
# ==================
|
|
- name: Run apt update
|
|
ansible.builtin.apt:
|
|
update_cache: yes
|
|
|
|
- name: Restart pveproxy
|
|
ansible.builtin.systemd:
|
|
name: pveproxy
|
|
state: restarted
|
|
|
|
- name: Reload systemd
|
|
ansible.builtin.systemd_service:
|
|
daemon_reexec: true
|
|
|
|
- name: Patch legacy proxmoxlib.js
|
|
block:
|
|
- name: Patch legacy proxmoxlib.js
|
|
ansible.builtin.replace:
|
|
path: /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js
|
|
regexp: "if \\(data.status !== 'Active'\\)"
|
|
replace: "if (false)"
|
|
register: patch_legacy
|
|
failed_when: patch_legacy.matched == 0
|
|
notify: Restart pveproxy
|
|
|
|
- name: Re-stat proxmoxlib.js
|
|
ansible.builtin.stat:
|
|
path: /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js
|
|
checksum_algorithm: sha256
|
|
register: proxmoxlib_js_after
|
|
|
|
- name: 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_after.stat.checksum }}\n"
|
|
|
|
- name: Restart pveproxy
|
|
ansible.builtin.systemd:
|
|
name: pveproxy
|
|
state: restarted
|
|
|
|
- name: Patch minified proxmoxlib.js
|
|
block:
|
|
- name: Patch minified proxmoxlib.min.js
|
|
ansible.builtin.replace:
|
|
path: /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.min.js
|
|
regexp: "data.status!=='Active'"
|
|
replace: "false"
|
|
register: patch_minified
|
|
failed_when: patch_minified.matched == 0
|
|
|
|
- name: Re-stat proxmoxlib.min.js
|
|
ansible.builtin.stat:
|
|
path: /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.min.js
|
|
checksum_algorithm: sha256
|
|
register: proxmoxlib_min_after
|
|
|
|
- name: Store patched checksum (minified)
|
|
ansible.builtin.copy:
|
|
dest: /var/lib/proxmox-nag-patch/proxmoxlib.min.js.sha256
|
|
owner: root
|
|
group: root
|
|
mode: "0644"
|
|
content: "{{ proxmoxlib_min_after.stat.checksum }}\n"
|
|
|
|
- name: Restart pveproxy
|
|
ansible.builtin.systemd:
|
|
name: pveproxy
|
|
state: restarted
|