def guest():
guest = {'hosts': [],
'vars': {'ansible_python_interpreter': '/usr/bin/python',
'hv_node_netmask': '255.255.0.0',
'hv_node_broadcast': '10.0.255.255'}}
c = libvirt.openReadOnly("qemu:///system")
if c != None:
for i in c.listDomainsID():
dom = c.lookupByID(i)
if dom.name().startswith('hv'):
guest['hosts'].append(dom.name())
return guest
评论列表
文章目录