|
|
@ -41,7 +41,7 @@ options:
|
|
|
|
- the instance id
|
|
|
|
- the instance id
|
|
|
|
default: null
|
|
|
|
default: null
|
|
|
|
required: true
|
|
|
|
required: true
|
|
|
|
https_verify_ssl:
|
|
|
|
validate_certs:
|
|
|
|
description:
|
|
|
|
description:
|
|
|
|
- enable / disable https certificate verification
|
|
|
|
- enable / disable https certificate verification
|
|
|
|
default: false
|
|
|
|
default: false
|
|
|
@ -219,6 +219,7 @@ def create_instance(module, proxmox, vmid, node, disk, storage, cpus, memory, sw
|
|
|
|
% proxmox_node.tasks(taskid).log.get()[:1])
|
|
|
|
% proxmox_node.tasks(taskid).log.get()[:1])
|
|
|
|
|
|
|
|
|
|
|
|
time.sleep(1)
|
|
|
|
time.sleep(1)
|
|
|
|
|
|
|
|
return False
|
|
|
|
|
|
|
|
|
|
|
|
def start_instance(module, proxmox, vm, vmid, timeout):
|
|
|
|
def start_instance(module, proxmox, vm, vmid, timeout):
|
|
|
|
taskid = proxmox.nodes(vm[0]['node']).openvz(vmid).status.start.post()
|
|
|
|
taskid = proxmox.nodes(vm[0]['node']).openvz(vmid).status.start.post()
|
|
|
@ -272,7 +273,7 @@ def main():
|
|
|
|
api_user = dict(required=True),
|
|
|
|
api_user = dict(required=True),
|
|
|
|
api_password = dict(no_log=True),
|
|
|
|
api_password = dict(no_log=True),
|
|
|
|
vmid = dict(required=True),
|
|
|
|
vmid = dict(required=True),
|
|
|
|
https_verify_ssl = dict(type='bool', choices=BOOLEANS, default='no'),
|
|
|
|
validate_certs = dict(type='bool', choices=BOOLEANS, default='no'),
|
|
|
|
node = dict(),
|
|
|
|
node = dict(),
|
|
|
|
password = dict(no_log=True),
|
|
|
|
password = dict(no_log=True),
|
|
|
|
hostname = dict(),
|
|
|
|
hostname = dict(),
|
|
|
@ -302,7 +303,7 @@ def main():
|
|
|
|
api_host = module.params['api_host']
|
|
|
|
api_host = module.params['api_host']
|
|
|
|
api_password = module.params['api_password']
|
|
|
|
api_password = module.params['api_password']
|
|
|
|
vmid = module.params['vmid']
|
|
|
|
vmid = module.params['vmid']
|
|
|
|
https_verify_ssl = module.params['https_verify_ssl']
|
|
|
|
validate_certs = module.params['validate_certs']
|
|
|
|
node = module.params['node']
|
|
|
|
node = module.params['node']
|
|
|
|
disk = module.params['disk']
|
|
|
|
disk = module.params['disk']
|
|
|
|
cpus = module.params['cpus']
|
|
|
|
cpus = module.params['cpus']
|
|
|
@ -319,7 +320,7 @@ def main():
|
|
|
|
module.fail_json(msg='You should set api_password param or use PROXMOX_PASSWORD environment variable')
|
|
|
|
module.fail_json(msg='You should set api_password param or use PROXMOX_PASSWORD environment variable')
|
|
|
|
|
|
|
|
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
proxmox = ProxmoxAPI(api_host, user=api_user, password=api_password, verify_ssl=https_verify_ssl)
|
|
|
|
proxmox = ProxmoxAPI(api_host, user=api_user, password=api_password, verify_ssl=validate_certs)
|
|
|
|
except Exception, e:
|
|
|
|
except Exception, e:
|
|
|
|
module.fail_json(msg='authorization on proxmox cluster failed with exception: %s' % e)
|
|
|
|
module.fail_json(msg='authorization on proxmox cluster failed with exception: %s' % e)
|
|
|
|
|
|
|
|
|
|
|
|