mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Small cosmetic changes and documentation updates (#20632)
After merging the latest update, these were the few remaining differences with upstream. (Plus the previous proposed fast match based on unique VM name which is not longer needed)
This commit is contained in:
parent
d668d53112
commit
e06227ce16
1 changed files with 16 additions and 35 deletions
|
@ -53,42 +53,35 @@ options:
|
||||||
name_match:
|
name_match:
|
||||||
description:
|
description:
|
||||||
- If multiple VMs matching the name, use the first or last found
|
- If multiple VMs matching the name, use the first or last found
|
||||||
required: False
|
|
||||||
default: 'first'
|
default: 'first'
|
||||||
choices: ['first', 'last']
|
choices: ['first', 'last']
|
||||||
uuid:
|
uuid:
|
||||||
description:
|
description:
|
||||||
- UUID of the instance to manage if known, this is VMware's unique identifier.
|
- UUID of the instance to manage if known, this is VMware's unique identifier.
|
||||||
- This is required if name is not supplied.
|
- This is required if name is not supplied.
|
||||||
required: False
|
|
||||||
template:
|
template:
|
||||||
description:
|
description:
|
||||||
- Template used to create VM.
|
- Template used to create VM.
|
||||||
- If this value is not set, VM is created without using a template.
|
- If this value is not set, VM is created without using a template.
|
||||||
- If the VM exists already this setting will be ignored.
|
- If the VM exists already this setting will be ignored.
|
||||||
required: False
|
|
||||||
is_template:
|
is_template:
|
||||||
description:
|
description:
|
||||||
- Flag the instance as a template
|
- Flag the instance as a template
|
||||||
required: False
|
|
||||||
default: False
|
default: False
|
||||||
version_added: "2.3"
|
version_added: "2.3"
|
||||||
folder:
|
folder:
|
||||||
description:
|
description:
|
||||||
- Destination folder, absolute path to find an existing guest or create the new guest
|
- Destination folder, absolute path to find an existing guest or create the new guest
|
||||||
required: False
|
|
||||||
hardware:
|
hardware:
|
||||||
description:
|
description:
|
||||||
- "Manage some VM hardware attributes."
|
- "Manage some VM hardware attributes."
|
||||||
- "Valid attributes are: memory_mb, num_cpus and scsi"
|
- "Valid attributes are: memory_mb, num_cpus and scsi"
|
||||||
- "scsi: Valid values are buslogic, lsilogic, lsilogicsas and paravirtual (default)"
|
- "scsi: Valid values are buslogic, lsilogic, lsilogicsas and paravirtual (default)"
|
||||||
required: False
|
|
||||||
guest_id:
|
guest_id:
|
||||||
description:
|
description:
|
||||||
- "Set the guest ID (Debian, RHEL, Windows...)"
|
- "Set the guest ID (Debian, RHEL, Windows...)"
|
||||||
- "This field is required when creating a VM"
|
- "This field is required when creating a VM"
|
||||||
- "Valid values are referenced here: https://www.vmware.com/support/developer/converter-sdk/conv55_apireference/vim.vm.GuestOsDescriptor.GuestOsIdentifier.html"
|
- "Valid values are referenced here: https://www.vmware.com/support/developer/converter-sdk/conv55_apireference/vim.vm.GuestOsDescriptor.GuestOsIdentifier.html"
|
||||||
required: False
|
|
||||||
version_added: "2.3"
|
version_added: "2.3"
|
||||||
disk:
|
disk:
|
||||||
description:
|
description:
|
||||||
|
@ -97,23 +90,19 @@ options:
|
||||||
- "type: Valid value is thin (default: None)"
|
- "type: Valid value is thin (default: None)"
|
||||||
- "datastore: Datastore to use for the disk. If autoselect_datastore is True, filter datastore selection."
|
- "datastore: Datastore to use for the disk. If autoselect_datastore is True, filter datastore selection."
|
||||||
- "autoselect_datastore (bool): select the less used datastore."
|
- "autoselect_datastore (bool): select the less used datastore."
|
||||||
required: False
|
|
||||||
resource_pool:
|
resource_pool:
|
||||||
description:
|
description:
|
||||||
- Affect machine to the given resource pool
|
- Affect machine to the given resource pool
|
||||||
- Resource pool should be child of the selected host parent
|
- Resource pool should be child of the selected host parent
|
||||||
required: False
|
|
||||||
default: None
|
default: None
|
||||||
version_added: "2.3"
|
version_added: "2.3"
|
||||||
wait_for_ip_address:
|
wait_for_ip_address:
|
||||||
description:
|
description:
|
||||||
- Wait until vCenter detects an IP address for the VM
|
- Wait until vCenter detects an IP address for the VM
|
||||||
- This requires vmware-tools (vmtoolsd) to properly work after creation
|
- This requires vmware-tools (vmtoolsd) to properly work after creation
|
||||||
required: False
|
|
||||||
force:
|
force:
|
||||||
description:
|
description:
|
||||||
- Ignore warnings and complete the actions
|
- Ignore warnings and complete the actions
|
||||||
required: False
|
|
||||||
datacenter:
|
datacenter:
|
||||||
description:
|
description:
|
||||||
- Destination datacenter for the deploy operation
|
- Destination datacenter for the deploy operation
|
||||||
|
@ -121,22 +110,18 @@ options:
|
||||||
cluster:
|
cluster:
|
||||||
description:
|
description:
|
||||||
- The cluster name where the VM will run.
|
- The cluster name where the VM will run.
|
||||||
required: False
|
|
||||||
version_added: "2.3"
|
version_added: "2.3"
|
||||||
esxi_hostname:
|
esxi_hostname:
|
||||||
description:
|
description:
|
||||||
- The esxi hostname where the VM will run.
|
- The esxi hostname where the VM will run.
|
||||||
required: False
|
|
||||||
annotation:
|
annotation:
|
||||||
description:
|
description:
|
||||||
- A note or annotation to include in the VM
|
- A note or annotation to include in the VM
|
||||||
required: False
|
|
||||||
version_added: "2.3"
|
version_added: "2.3"
|
||||||
customvalues:
|
customvalues:
|
||||||
description:
|
description:
|
||||||
- Define a list of customvalues to set on VM.
|
- Define a list of customvalues to set on VM.
|
||||||
- "A customvalue object takes 2 fields 'key' and 'value'."
|
- "A customvalue object takes 2 fields 'key' and 'value'."
|
||||||
required: False
|
|
||||||
version_added: "2.3"
|
version_added: "2.3"
|
||||||
networks:
|
networks:
|
||||||
description:
|
description:
|
||||||
|
@ -145,13 +130,12 @@ options:
|
||||||
- Add an optional C(gateway) entry to configure a gateway
|
- Add an optional C(gateway) entry to configure a gateway
|
||||||
- Add an optional C(mac) entry to customize mac address
|
- Add an optional C(mac) entry to customize mac address
|
||||||
- Add an optional C(dns_servers) or C(domain) entry per interface (Windows)
|
- Add an optional C(dns_servers) or C(domain) entry per interface (Windows)
|
||||||
required: False
|
- Add an optional C(device_type) to configure the virtual NIC (pcnet32, vmxnet2, vmxnet3, e1000, e1000e)
|
||||||
version_added: "2.3"
|
version_added: "2.3"
|
||||||
snapshot_op:
|
snapshot_op:
|
||||||
description:
|
description:
|
||||||
- A key, value pair of snapshot operation types and their additional required parameters.
|
- A key, value pair of snapshot operation types and their additional required parameters.
|
||||||
- Beware that this functionality will disappear in v2.3 and move into module C(vmware_guest_snapshot)
|
- Beware that this functionality will disappear in v2.3 and move into module C(vmware_guest_snapshot)
|
||||||
required: False
|
|
||||||
version_added: "2.3"
|
version_added: "2.3"
|
||||||
customization:
|
customization:
|
||||||
description:
|
description:
|
||||||
|
@ -174,7 +158,6 @@ options:
|
||||||
- " productid (string): Product ID"
|
- " productid (string): Product ID"
|
||||||
- " runonce (list): List of commands to run at first user logon"
|
- " runonce (list): List of commands to run at first user logon"
|
||||||
- " timezone (int): Timezone (default: 85) See https://msdn.microsoft.com/en-us/library/ms912391(v=winembedded.11).aspx"
|
- " timezone (int): Timezone (default: 85) See https://msdn.microsoft.com/en-us/library/ms912391(v=winembedded.11).aspx"
|
||||||
required: False
|
|
||||||
version_added: "2.3"
|
version_added: "2.3"
|
||||||
extends_documentation_fragment: vmware.documentation
|
extends_documentation_fragment: vmware.documentation
|
||||||
'''
|
'''
|
||||||
|
@ -547,12 +530,10 @@ class PyVmomiHelper(object):
|
||||||
vm = self.content.searchIndex.FindByUuid(uuid=uuid, vmSearch=True)
|
vm = self.content.searchIndex.FindByUuid(uuid=uuid, vmSearch=True)
|
||||||
elif folder:
|
elif folder:
|
||||||
# Build the absolute folder path to pass into the search method
|
# Build the absolute folder path to pass into the search method
|
||||||
if self.params['folder'].startswith('/'):
|
if not self.params['folder'].startswith('/'):
|
||||||
searchpath = '%(datacenter)s%(folder)s' % self.params
|
|
||||||
else:
|
|
||||||
self.module.fail_json(msg="Folder %(folder)s needs to be an absolute path, starting with '/'." % self.params)
|
self.module.fail_json(msg="Folder %(folder)s needs to be an absolute path, starting with '/'." % self.params)
|
||||||
|
searchpath = '%(datacenter)s%(folder)s' % self.params
|
||||||
|
|
||||||
if searchpath:
|
|
||||||
# get all objects for this path ...
|
# get all objects for this path ...
|
||||||
f_obj = self.content.searchIndex.FindByInventoryPath(searchpath)
|
f_obj = self.content.searchIndex.FindByInventoryPath(searchpath)
|
||||||
if f_obj:
|
if f_obj:
|
||||||
|
@ -921,7 +902,7 @@ class PyVmomiHelper(object):
|
||||||
ident.guiUnattended.password.value = str(self.params['customization']['password'])
|
ident.guiUnattended.password.value = str(self.params['customization']['password'])
|
||||||
ident.guiUnattended.password.plainText = True
|
ident.guiUnattended.password.plainText = True
|
||||||
else:
|
else:
|
||||||
self.module.fail_json(msg="The 'customization' section requires 'password' entry, which cannot be empty.")
|
self.module.fail_json(msg="The 'customization' section requires a 'password' entry, which cannot be empty.")
|
||||||
|
|
||||||
if 'productid' in self.params['customization']:
|
if 'productid' in self.params['customization']:
|
||||||
ident.userData.orgName = str(self.params['customization']['productid'])
|
ident.userData.orgName = str(self.params['customization']['productid'])
|
||||||
|
|
Loading…
Reference in a new issue