Compare commits
4 Commits
Author | SHA1 | Date |
---|---|---|
Xabi | bd1f2b1dbc | |
Xabi | 4f06c2bd9e | |
maynero | 83005f4ab6 | |
Xabi Ezpeleta | d7b01396b5 |
|
@ -1,5 +1,11 @@
|
|||
# Changelog
|
||||
|
||||
## v1.0.2
|
||||
- Proxmox v7 compatibility check if template key exists (by @maynero) [#39](https://github.com/xezpeleta/Ansible-Proxmox-inventory/pull/39)
|
||||
|
||||
## v1.0.1
|
||||
- Ommit group when OS id is empty (d7b0139)
|
||||
|
||||
## v1.0.0
|
||||
- Added option to ignore invalid SSL certificate (by @bmillemathias) [PR](https://github.com/ansible/ansible/pull/17247)
|
||||
- Compatible with a Proxmox cluster (by @xezpeleta)
|
||||
|
|
13
proxmox.py
13
proxmox.py
|
@ -65,7 +65,7 @@ class ProxmoxVMList(list):
|
|||
|
||||
def get_names(self):
|
||||
if self.ver >= 4.0:
|
||||
return [vm['name'] for vm in self if vm['template'] != 1]
|
||||
return [vm['name'] for vm in self if 'template' in vm and vm['template'] != 1]
|
||||
else:
|
||||
return [vm['name'] for vm in self]
|
||||
|
||||
|
@ -370,11 +370,12 @@ def main_list(options, config_path):
|
|||
|
||||
if 'proxmox_os_id' in results['_meta']['hostvars'][vm]:
|
||||
osid = results['_meta']['hostvars'][vm]['proxmox_os_id']
|
||||
if osid not in results:
|
||||
results[osid] = {
|
||||
'hosts': []
|
||||
}
|
||||
results[osid]['hosts'] += [vm]
|
||||
if osid:
|
||||
if osid not in results:
|
||||
results[osid] = {
|
||||
'hosts': []
|
||||
}
|
||||
results[osid]['hosts'] += [vm]
|
||||
|
||||
results['_meta']['hostvars'][vm].update(metadata)
|
||||
|
||||
|
|
Reference in New Issue