feat ✨: Add ignore_errors, when condition, and reset fact; update script registration
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.
This commit is contained in:
@@ -32,13 +32,19 @@
|
|||||||
- name: Run uninstall script
|
- name: Run uninstall script
|
||||||
ansible.builtin.shell: |
|
ansible.builtin.shell: |
|
||||||
/usr/local/bin/pve-mod-gui-sensors.sh uninstall
|
/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
|
- name: Wait for Proxmox Web GUI to be up
|
||||||
wait_for:
|
wait_for:
|
||||||
port: 8006
|
port: 8006
|
||||||
delay: 5
|
delay: 5
|
||||||
timeout: 60
|
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
|
- name: Run pve-mod-gui-sensors script with predefined answers
|
||||||
expect:
|
expect:
|
||||||
command: /usr/local/src/pve-mod-gui-sensors.sh install
|
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'
|
'Display temperatures in Celsius \[C\] or Fahrenheit \[f\].*\(C/f\):.*': 'c'
|
||||||
'Enable UPS information\?.*\(y/N\):.*': 'n'
|
'Enable UPS information\?.*\(y/N\):.*': 'n'
|
||||||
'Enable system information\?.*\(1/2/n\):.*': '2'
|
'Enable system information\?.*\(1/2/n\):.*': '2'
|
||||||
|
register: pve_mod_gui_sensors_installed
|
||||||
|
|
||||||
- name: Wait for Proxmox Web GUI to be up
|
- name: Wait for Proxmox Web GUI to be up
|
||||||
wait_for:
|
wait_for:
|
||||||
|
|||||||
Reference in New Issue
Block a user