Identifying a proxmox installation

Apr 3, 2023
5
0
6
Normal linux commands like using lsb_release or looking at /etc/os-release does not identify the system as being a proxmox system. This causes an issue when I try to identify the system using ansible. I could easily write a facts script that identifies it as a proxmox system but I was wondering if there is a defined way to do this in Proxmox already.

I guess I can run pveversion, but it doesn't parameterize the values and I would have to parse them.
 
I think you have given a specific hostname to pve hosts. Then u can use the outout of the hostname command or file.
 
Normal linux commands like using lsb_release or looking at /etc/os-release does not identify the system as being a proxmox system. This causes an issue when I try to identify the system using ansible. I could easily write a facts script that identifies it as a proxmox system but I was wondering if there is a defined way to do this in Proxmox already.
If you just want to detect if a system is a PVE system, check for the directory /etc/pve. If you want a version, just check the package version of pve-manager via some internal ansible dpkg interface.
 
I was hoping there would be a simple way to trigger off of something that already get processed by the ansible facts system like os-release but there really isn't. Using a package query is a potential idea but it would happen outside of the facts generation system which complicates it a little. Looking at the default facts the only thing I have to query off of is either the kernel name or numerous device mapper references which all have "pve" in them.