vmware_rest_client: define 'port' parameter (#66506)
Ensure the `vmware_rest_client` based modules accept the `port` parameter.
This commit is contained in:
parent
5edd076241
commit
cd760782c9
2 changed files with 12 additions and 1 deletions
|
@ -101,6 +101,9 @@ class VmwareRestClient(object):
|
||||||
fallback=(env_fallback, ['VMWARE_PASSWORD']),
|
fallback=(env_fallback, ['VMWARE_PASSWORD']),
|
||||||
aliases=['pass', 'pwd'],
|
aliases=['pass', 'pwd'],
|
||||||
no_log=True),
|
no_log=True),
|
||||||
|
port=dict(type='int',
|
||||||
|
default=443,
|
||||||
|
fallback=(env_fallback, ['VMWARE_PORT'])),
|
||||||
protocol=dict(type='str',
|
protocol=dict(type='str',
|
||||||
default='https',
|
default='https',
|
||||||
choices=['https', 'http']),
|
choices=['https', 'http']),
|
||||||
|
@ -117,6 +120,7 @@ class VmwareRestClient(object):
|
||||||
username = self.params.get('username')
|
username = self.params.get('username')
|
||||||
password = self.params.get('password')
|
password = self.params.get('password')
|
||||||
hostname = self.params.get('hostname')
|
hostname = self.params.get('hostname')
|
||||||
|
port = self.params.get('port')
|
||||||
session = requests.Session()
|
session = requests.Session()
|
||||||
session.verify = self.params.get('validate_certs')
|
session.verify = self.params.get('validate_certs')
|
||||||
|
|
||||||
|
@ -125,7 +129,7 @@ class VmwareRestClient(object):
|
||||||
" Please read the documentation for more information.")
|
" Please read the documentation for more information.")
|
||||||
|
|
||||||
client = create_vsphere_client(
|
client = create_vsphere_client(
|
||||||
server=hostname,
|
server="%s:%s" % (hostname, port),
|
||||||
username=username,
|
username=username,
|
||||||
password=password,
|
password=password,
|
||||||
session=session)
|
session=session)
|
||||||
|
|
|
@ -33,6 +33,13 @@ options:
|
||||||
- If the value is not specified in the task, the value of environment variable C(VMWARE_VALIDATE_CERTS) will be used instead.
|
- If the value is not specified in the task, the value of environment variable C(VMWARE_VALIDATE_CERTS) will be used instead.
|
||||||
type: bool
|
type: bool
|
||||||
default: yes
|
default: yes
|
||||||
|
port:
|
||||||
|
description:
|
||||||
|
- The port number of the vSphere vCenter.
|
||||||
|
- If the value is not specified in the task, the value of environment variable C(VMWARE_PORT) will be used instead.
|
||||||
|
type: int
|
||||||
|
default: 443
|
||||||
|
version_added: '2.10'
|
||||||
protocol:
|
protocol:
|
||||||
description:
|
description:
|
||||||
- The connection to protocol.
|
- The connection to protocol.
|
||||||
|
|
Loading…
Reference in a new issue