New in version 2.9.
The below requirements are needed on the host that executes this module.
| Parameter | Choices/Defaults | Comments | 
|---|---|---|
| cluster  string  | Name of the cluster in datacenter in which to place deployed VM. | |
| datacenter  string / required  | Name of the datacenter, where VM to be deployed. | |
| datastore  string / required  | Name of the datastore to store deployed VM and disk. | |
| folder  string / required  | Name of the folder in datacenter in which to place deployed VM. | |
| host  string / required  | Name of the ESX Host in datacenter in which to place deployed VM. | |
| hostname  string  | The hostname or IP address of the vSphere vCenter server. If the value is not specified in the task, the value of environment variable  VMWARE_HOSTwill be used instead. | |
| name  string / required  | The name of the VM to be deployed. aliases: vm_name | |
| password  string  | The password of the vSphere vCenter server. If the value is not specified in the task, the value of environment variable  VMWARE_PASSWORDwill be used instead.aliases: pass, pwd | |
| protocol  string  | 
 | The connection to protocol. | 
| resource_pool  string  | Name of the resourcepool in datacenter in which to place deployed VM. | |
| state  string  | 
 | The state of Virtual Machine deployed from template in content library. If set to  presentand VM does not exists, then VM is created.If set to  presentand VM exists, no action is taken.If set to  poweredonand VM does not exists, then VM is created with powered on state.If set to  poweredonand VM exists, no action is taken. | 
| template  string / required  | The name of template from which VM to be deployed. aliases: template_src | |
| username  string  | The username of the vSphere vCenter server. If the value is not specified in the task, the value of environment variable  VMWARE_USERwill be used instead.aliases: admin, user | |
| validate_certs  boolean  | 
 | Allows connection when SSL certificates are not valid. Set to  nowhen certificates are not trusted.If the value is not specified in the task, the value of environment variable  VMWARE_VALIDATE_CERTSwill be used instead. | 
Note
- name: Deploy Virtual Machine from template in content library
  vmware_content_deploy_template:
    hostname: '{{ vcenter_hostname }}'
    username: '{{ vcenter_username }}'
    password: '{{ vcenter_password }}'
    template: rhel_test_template
    datastore: Shared_NFS_Volume
    folder: vm
    datacenter: Sample_DC_1
    name: Sample_VM
    resource_pool: test_rp
    validate_certs: False
    state: present
  delegate_to: localhost
- name: Deploy Virtual Machine from template in content library with PowerON State
  vmware_content_deploy_template:
    hostname: '{{ vcenter_hostname }}'
    username: '{{ vcenter_username }}'
    password: '{{ vcenter_password }}'
    template: rhel_test_template
    datastore: Shared_NFS_Volume
    folder: vm
    datacenter: Sample_DC_1
    name: Sample_VM
    resource_pool: test_rp
    validate_certs: False
    state: poweredon
  delegate_to: localhost
   Common return values are documented here, the following are the fields unique to this module:
| Key | Returned | Description | 
|---|---|---|
| vm_deploy_info  dictionary  | on success | Virtual machine deployment message and vm_id Sample: {'msg': "Deployed Virtual Machine 'Sample_VM'.", 'vm_id': 'vm-1009'} | 
Hint
If you notice any issues in this documentation, you can edit this document to improve it.
    © 2012–2018 Michael DeHaan
© 2018–2019 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
    https://docs.ansible.com/ansible/2.9/modules/vmware_content_deploy_template_module.html