Identifying a proxmox installation

invalidusername

New Member
Apr 3, 2023
4
0
1
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.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!