Filter on qemu and lxc resources only

# SUMMARY
When using proxmox.py as a dynamic inventory for Ansible, only VM and lxc must be included in the output. Other resources such as datastores must be excluded.

# ISSUE TYPE
Bugfix Pull Request

# ADDITIONAL INFORMATION
If a datastore is defined in a pool, the script crashes as the parameter template does not apply to datastore objects.

# VERSION
PVE 5.4.13
This commit is contained in:
adubreuiltk 2019-08-31 11:10:23 +02:00 committed by GitHub
parent ba77d56258
commit 6255b78e92
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -91,7 +91,7 @@ class ProxmoxVersion(dict):
class ProxmoxPool(dict):
def get_members_name(self):
return [member['name'] for member in self['members'] if member['template'] != 1]
return [member['name'] for member in self['members'] if (member['type'] == 'qemu' or member['type'] == 'lxc') and member['template'] != 1]
class ProxmoxAPI(object):