debian: improve proxmox detection

Assume non-proxmox debians don’t have /etc/pve so we don’t have to
depend on NetBox data.
This commit is contained in:
Timotej Lazar 2025-08-14 10:08:54 +02:00
parent 246178fa5d
commit e28bb50a9e

View file

@ -1,3 +1,11 @@
- block:
- name: Determine if this is a Proxmox host
stat:
path: /etc/pve
register: stat_pve
- set_fact:
is_proxmox: "{{ stat_pve.stat.exists and stat_pve.stat.isdir }}"
- name: Configure MOTD
template:
dest: /etc/motd
@ -77,7 +85,7 @@
- name: Set up firewall
include_tasks: firewall.yml
when: is_virtual or cluster_type != 'proxmox' # proxmox has its own firewall configuration
when: not is_proxmox # proxmox has its own firewall configuration
- name: Install automatic upgrade package
package: