Files
ansible_samba_tasks/tasks/proxmox.yml
Jose dc52a02df7 refactor ♻️: Refactor uninstall script task to use ansible.builtin.shell instead of ansible.builtin.command
Updated the uninstall script task to use `ansible.builtin.shell` for better command execution and flexibility.
2025-12-16 21:05:38 +01:00

54 lines
1.5 KiB
YAML

- name: Setup Proxmox
hosts: proxmox
become: true
tasks:
- name: Ensure git is installed
ansible.builtin.apt:
pkg:
- git
- python3-proxmoxer
- lm-sensors
- python3-pexpect
state: present
update_cache: yes
cache_valid_time: 3600
- name: Download the PVE GUI sensors script
ansible.builtin.get_url:
url: https://raw.githubusercontent.com/Meliox/PVE-mods/refs/heads/main/pve-mod-gui-sensors.sh
dest: /tmp/pve-mod-gui-sensors.sh
mode: '0755' # Make it executable
- name: Run uninstall script
ansible.builtin.shell: bash /tmp/pve-mod-gui-sensors.sh uninstall
ignore_errors: true
- 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
ansible.builtin.expect:
command: bash /tmp/pve-mod-gui-sensors.sh install
responses:
'Display temperatures for all cores \[C\] or average per CPU \[a\].*\(C/a\):.*': 'a'
'Display temperatures in Celsius \[C\] or Fahrenheit \[f\].*\(C/f\):.*': 'c'
'Enable UPS information\?.*\(y/N\):.*': 'n'
'Enable system information\?.*\(1/2/n\):.*': '2'
ignore_errors: true
- name: Wait for Proxmox Web GUI to be up
wait_for:
port: 8006
delay: 5
timeout: 60