proxmox | changed https_verify_ssl to to validate_certs and added forgotten return
This commit is contained in:
parent
73cfe2f3c7
commit
89e13e2ae8
1 changed files with 5 additions and 4 deletions
|
@ -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)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue