From a08dfae8437e4c0c6e87565e1a2a3bda606acf78 Mon Sep 17 00:00:00 2001 From: Jose Date: Tue, 16 Dec 2025 19:55:28 +0100 Subject: [PATCH] =?UTF-8?q?feat=20=E2=9C=A8:=20Add=20ignore=5Ferrors,=20wh?= =?UTF-8?q?en=20condition,=20and=20reset=20fact;=20update=20script=20regis?= =?UTF-8?q?tration?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit introduces new functionality to include error handling, conditional execution, and state reset in scripts. It also updates the script registration process to ensure compatibility with these changes. --- tasks/proxmox.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tasks/proxmox.yml b/tasks/proxmox.yml index 67dcbc2..eb52971 100644 --- a/tasks/proxmox.yml +++ b/tasks/proxmox.yml @@ -32,13 +32,19 @@ - name: Run uninstall script ansible.builtin.shell: | /usr/local/bin/pve-mod-gui-sensors.sh uninstall - + ignore_errors: true + when: pve_mod_gui_sensors_installed | default(false) + - name: Wait for Proxmox Web GUI to be up wait_for: port: 8006 delay: 5 timeout: 60 - + + - name: Reset install fact + ansible.builtin.set_fact: + pve_mod_gui_sensors_installed: null + - name: Run pve-mod-gui-sensors script with predefined answers expect: command: /usr/local/src/pve-mod-gui-sensors.sh install @@ -47,6 +53,7 @@ 'Display temperatures in Celsius \[C\] or Fahrenheit \[f\].*\(C/f\):.*': 'c' 'Enable UPS information\?.*\(y/N\):.*': 'n' 'Enable system information\?.*\(1/2/n\):.*': '2' + register: pve_mod_gui_sensors_installed - name: Wait for Proxmox Web GUI to be up wait_for: