Enable env vars for vsphere_guest
This commit allows the connection information for the vsphere_guest module to be provided as environment variables, which makes it possible to use Cloud Credentials from Ansible Tower in playbooks that utilize vsphere_guest. | ENV VAR | vsphere_guest param | | --------------- | ---------------------- | | VMWARE_HOST | vcenter_hostname | | VMWARE_USER | username | | VMWARE_PASSWORD | password |
This commit is contained in:
parent
ea8097a821
commit
bc834ff564
1 changed files with 12 additions and 3 deletions
|
@ -1604,9 +1604,18 @@ def main():
|
||||||
|
|
||||||
module = AnsibleModule(
|
module = AnsibleModule(
|
||||||
argument_spec=dict(
|
argument_spec=dict(
|
||||||
vcenter_hostname=dict(required=True, type='str'),
|
vcenter_hostname=dict(
|
||||||
username=dict(required=True, type='str'),
|
type='str',
|
||||||
password=dict(required=True, type='str', no_log=True),
|
default=os.environ['VMWARE_HOST']
|
||||||
|
),
|
||||||
|
username=dict(
|
||||||
|
type='str',
|
||||||
|
default=os.environ['VMWARE_USER']
|
||||||
|
),
|
||||||
|
password=dict(
|
||||||
|
type='str', no_log=True,
|
||||||
|
default=os.environ['VMWARE_PASSWORD']
|
||||||
|
),
|
||||||
state=dict(
|
state=dict(
|
||||||
required=False,
|
required=False,
|
||||||
choices=[
|
choices=[
|
||||||
|
|
Loading…
Reference in a new issue