Fix logging into vCloud Director and expose verify_certs argument (#15533)
This commit is contained in:
parent
56ba10365c
commit
be87cd8c26
1 changed files with 7 additions and 2 deletions
|
@ -46,7 +46,8 @@ def vca_argument_spec():
|
||||||
api_version=dict(default=DEFAULT_VERSION),
|
api_version=dict(default=DEFAULT_VERSION),
|
||||||
service_type=dict(default=DEFAULT_SERVICE_TYPE, choices=SERVICE_MAP.keys()),
|
service_type=dict(default=DEFAULT_SERVICE_TYPE, choices=SERVICE_MAP.keys()),
|
||||||
vdc_name=dict(),
|
vdc_name=dict(),
|
||||||
gateway_name=dict(default='gateway')
|
gateway_name=dict(default='gateway'),
|
||||||
|
verify_certs=dict(type='bool', default=True)
|
||||||
)
|
)
|
||||||
|
|
||||||
class VcaAnsibleModule(AnsibleModule):
|
class VcaAnsibleModule(AnsibleModule):
|
||||||
|
@ -130,7 +131,11 @@ class VcaAnsibleModule(AnsibleModule):
|
||||||
service_type = self.params['service_type']
|
service_type = self.params['service_type']
|
||||||
password = self.params['password']
|
password = self.params['password']
|
||||||
|
|
||||||
if not self.vca.login(password=password):
|
login_org = None
|
||||||
|
if service_type == 'vcd':
|
||||||
|
login_org = self.params['org']
|
||||||
|
|
||||||
|
if not self.vca.login(password=password, org=login_org):
|
||||||
self.fail('Login to VCA failed', response=self.vca.response.content)
|
self.fail('Login to VCA failed', response=self.vca.response.content)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in a new issue