community / community.vmware / 1.18.2 / module / vmware_deploy_ovf Deploys a VMware virtual machine from an OVF or OVA file Authors: Matt Martz (@sivel)community.vmware.vmware_deploy_ovf (1.18.2) — module
Install with ansible-galaxy collection install community.vmware:==1.18.2
collections: - name: community.vmware version: 1.18.2
This module can be used to deploy a VMware VM from an OVF or OVA file
- community.vmware.vmware_deploy_ovf: hostname: '{{ vcenter_hostname }}' username: '{{ vcenter_username }}' password: '{{ vcenter_password }}' ovf: /path/to/ubuntu-16.04-amd64.ovf wait_for_ip_address: true delegate_to: localhost
# Deploys a new VM named 'NewVM' in specific datacenter/cluster, with network mapping taken from variable and using ova template from an absolute path - community.vmware.vmware_deploy_ovf: hostname: '{{ vcenter_hostname }}' username: '{{ vcenter_username }}' password: '{{ vcenter_password }}' datacenter: Datacenter1 cluster: Cluster1 datastore: vsandatastore name: NewVM networks: "{u'VM Network':u'{{ ProvisioningNetworkLabel }}'}" power_on: no ovf: /absolute/path/to/template/mytemplate.ova delegate_to: localhost
- community.vmware.vmware_deploy_ovf: hostname: '{{ vcenter_hostname }}' username: '{{ vcenter_username }}' password: '{{ vcenter_password }}' datacenter: Datacenter1 esxi_hostname: test-server datastore: test-datastore ovf: /path/to/ubuntu-16.04-amd64.ovf delegate_to: localhost
ovf: aliases: - ova description: - Path to OVF or OVA file to deploy. type: path name: description: - Name of the VM to work with. - Virtual machine names in vCenter are not necessarily unique, which may be problematic. type: str port: default: 443 description: - The port number of the vSphere vCenter or ESXi server. - If the value is not specified in the task, the value of environment variable C(VMWARE_PORT) will be used instead. - Environment variable support added in Ansible 2.6. type: int wait: default: true description: - Wait for the host to power on. type: bool folder: description: - Absolute path of folder to place the virtual machine. - If not specified, defaults to the value of C(datacenter.vmFolder). - 'Examples:' - ' folder: /ha-datacenter/vm' - ' folder: ha-datacenter/vm' - ' folder: /datacenter1/vm' - ' folder: datacenter1/vm' - ' folder: /datacenter1/vm/folder1' - ' folder: datacenter1/vm/folder1' - ' folder: /folder1/datacenter1/vm' - ' folder: folder1/datacenter1/vm' - ' folder: /folder1/datacenter1/vm/folder2' type: str cluster: description: - Cluster to deploy to. - This is a required parameter, if C(esxi_hostname) is not set and C(hostname) is set to the vCenter server. - C(esxi_hostname) and C(cluster) are mutually exclusive parameters. - This parameter is case sensitive. type: str hostname: description: - The hostname or IP address of the vSphere vCenter or ESXi server. - If the value is not specified in the task, the value of environment variable C(VMWARE_HOST) will be used instead. - Environment variable support added in Ansible 2.6. type: str networks: default: VM Network: VM Network description: - 'C(key: value) mapping of OVF network name, to the vCenter network name.' type: dict password: aliases: - pass - pwd description: - The password of the vSphere vCenter or ESXi server. - If the value is not specified in the task, the value of environment variable C(VMWARE_PASSWORD) will be used instead. - Environment variable support added in Ansible 2.6. type: str power_on: default: true description: - Whether or not to power on the virtual machine after creation. type: bool username: aliases: - admin - user description: - The username of the vSphere vCenter or ESXi server. - If the value is not specified in the task, the value of environment variable C(VMWARE_USER) will be used instead. - Environment variable support added in Ansible 2.6. type: str datastore: default: datastore1 description: - Datastore to deploy to. type: str datacenter: default: ha-datacenter description: - Datacenter to deploy to. type: str properties: description: - The assignment of values to the properties found in the OVF as key value pairs. type: dict proxy_host: description: - Address of a proxy that will receive all HTTPS requests and relay them. - The format is a hostname or a IP. - If the value is not specified in the task, the value of environment variable C(VMWARE_PROXY_HOST) will be used instead. - This feature depends on a version of pyvmomi greater than v6.7.1.2018.12 required: false type: str proxy_port: description: - Port of the HTTP proxy that will receive all HTTPS requests and relay them. - If the value is not specified in the task, the value of environment variable C(VMWARE_PROXY_PORT) will be used instead. required: false type: int esxi_hostname: description: - The ESXi hostname where the virtual machine will run. - This is a required parameter, if C(cluster) is not set and C(hostname) is set to the vCenter server. - C(esxi_hostname) and C(cluster) are mutually exclusive parameters. - This parameter is case sensitive. type: str version_added: 1.9.0 version_added_collection: community.vmware resource_pool: default: Resources description: - Resource Pool to deploy to. type: str inject_ovf_env: default: false description: - Force the given properties to be inserted into an OVF Environment and injected through VMware Tools. type: bool validate_certs: default: true description: - Allows connection when SSL certificates are not valid. Set to C(false) when certificates are not trusted. - If the value is not specified in the task, the value of environment variable C(VMWARE_VALIDATE_CERTS) will be used instead. - Environment variable support added in Ansible 2.6. - If set to C(true), please make sure Python >= 2.7.9 is installed on the given machine. type: bool allow_duplicates: default: 'True' description: - Whether or not to allow duplicate VM names. ESXi allows duplicates, vCenter may not. type: bool deployment_option: description: - The key of the chosen deployment option. type: str disk_provisioning: choices: - flat - eagerZeroedThick - monolithicSparse - twoGbMaxExtentSparse - twoGbMaxExtentFlat - thin - sparse - thick - seSparse - monolithicFlat default: thin description: - Disk provisioning type. type: str wait_for_ip_address: default: false description: - Wait until vCenter detects an IP address for the VM. - This requires vmware-tools (vmtoolsd) to properly work after creation. type: bool fail_on_spec_warnings: default: false description: - Cause the module to treat OVF Import Spec warnings as errors. type: bool
instance: description: metadata about the new virtual machine returned: always sample: None type: dict