|
|
@ -28,7 +28,13 @@ author:
|
|
|
|
'''
|
|
|
|
'''
|
|
|
|
|
|
|
|
|
|
|
|
import platform
|
|
|
|
import platform
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
HAVE_XENAPI = False
|
|
|
|
|
|
|
|
try:
|
|
|
|
import XenAPI
|
|
|
|
import XenAPI
|
|
|
|
|
|
|
|
HAVE_XENAPI = True
|
|
|
|
|
|
|
|
except ImportError:
|
|
|
|
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
EXAMPLES = '''
|
|
|
|
EXAMPLES = '''
|
|
|
|
- name: Gather facts from xenserver
|
|
|
|
- name: Gather facts from xenserver
|
|
|
@ -158,6 +164,9 @@ def get_srs(session):
|
|
|
|
def main():
|
|
|
|
def main():
|
|
|
|
module = AnsibleModule({})
|
|
|
|
module = AnsibleModule({})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if not HAVE_XENAPI:
|
|
|
|
|
|
|
|
module.fail_json(changed=False, msg="python xen api required for this module")
|
|
|
|
|
|
|
|
|
|
|
|
obj = XenServerFacts()
|
|
|
|
obj = XenServerFacts()
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
session = get_xenapi_session()
|
|
|
|
session = get_xenapi_session()
|
|
|
|