2025-12-16 17:43:51 +01:00
|
|
|
- name: Setup Proxmox
|
2025-12-11 21:10:06 +01:00
|
|
|
hosts: proxmox
|
2025-12-16 17:43:51 +01:00
|
|
|
become: true
|
|
|
|
|
|
2025-12-11 21:10:06 +01:00
|
|
|
|
|
|
|
|
tasks:
|
2025-12-16 18:18:33 +01:00
|
|
|
|
|
|
|
|
- name: Ensure git is installed
|
|
|
|
|
ansible.builtin.apt:
|
2025-12-16 18:35:57 +01:00
|
|
|
pkg:
|
|
|
|
|
- git
|
|
|
|
|
- python3-proxmoxer
|
|
|
|
|
- lm-sensors
|
2025-12-16 20:36:04 +01:00
|
|
|
- python3-pexpect
|
2025-12-16 18:18:33 +01:00
|
|
|
state: present
|
|
|
|
|
update_cache: yes
|
2025-12-16 18:35:57 +01:00
|
|
|
cache_valid_time: 3600
|
2025-12-11 21:10:06 +01:00
|
|
|
|
|
|
|
|
- name: Clone PVE-mods repository
|
|
|
|
|
ansible.builtin.git:
|
|
|
|
|
repo: "https://github.com/Meliox/PVE-mods.git"
|
|
|
|
|
dest: "/opt/PVE-mods"
|
|
|
|
|
version: "main"
|
|
|
|
|
update: yes
|
|
|
|
|
|
|
|
|
|
- name: Install pve-mod-gui-sensors.sh
|
|
|
|
|
ansible.builtin.copy:
|
|
|
|
|
src: "/opt/PVE-mods/pve-mod-gui-sensors.sh"
|
|
|
|
|
dest: "/usr/local/bin/pve-mod-gui-sensors.sh"
|
|
|
|
|
mode: "0755"
|
2025-12-16 18:26:33 +01:00
|
|
|
remote_src: yes
|
2025-12-11 21:10:06 +01:00
|
|
|
|
2025-12-16 19:25:16 +01:00
|
|
|
- name: Run uninstall script
|
2025-12-16 20:39:02 +01:00
|
|
|
ansible.builtin.shell:
|
|
|
|
|
cmd: /usr/local/bin/pve-mod-gui-sensors.sh uninstall
|
2025-12-16 19:55:28 +01:00
|
|
|
ignore_errors: true
|
|
|
|
|
when: pve_mod_gui_sensors_installed | default(false)
|
|
|
|
|
|
2025-12-16 19:29:37 +01:00
|
|
|
- name: Wait for Proxmox Web GUI to be up
|
|
|
|
|
wait_for:
|
|
|
|
|
port: 8006
|
|
|
|
|
delay: 5
|
|
|
|
|
timeout: 60
|
2025-12-16 19:55:28 +01:00
|
|
|
|
|
|
|
|
- name: Reset install fact
|
|
|
|
|
ansible.builtin.set_fact:
|
|
|
|
|
pve_mod_gui_sensors_installed: null
|
|
|
|
|
|
2025-12-16 19:25:16 +01:00
|
|
|
- name: Run pve-mod-gui-sensors script with predefined answers
|
2025-12-16 19:21:29 +01:00
|
|
|
expect:
|
2025-12-16 19:25:16 +01:00
|
|
|
command: /usr/local/src/pve-mod-gui-sensors.sh install
|
2025-12-16 19:21:29 +01:00
|
|
|
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'
|
2025-12-16 19:55:28 +01:00
|
|
|
register: pve_mod_gui_sensors_installed
|
2025-12-16 19:29:37 +01:00
|
|
|
|
|
|
|
|
- name: Wait for Proxmox Web GUI to be up
|
|
|
|
|
wait_for:
|
|
|
|
|
port: 8006
|
|
|
|
|
delay: 5
|
|
|
|
|
timeout: 60
|
|
|
|
|
|