From e28bb50a9ebf1ae20f5e9e6ba49ab73c8d718af5 Mon Sep 17 00:00:00 2001 From: Timotej Lazar Date: Thu, 14 Aug 2025 10:08:54 +0200 Subject: [PATCH] debian: improve proxmox detection MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Assume non-proxmox debians don’t have /etc/pve so we don’t have to depend on NetBox data. --- roles/debian/tasks/main.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/roles/debian/tasks/main.yml b/roles/debian/tasks/main.yml index 70f3e7d..81e3749 100644 --- a/roles/debian/tasks/main.yml +++ b/roles/debian/tasks/main.yml @@ -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: