simplygeekuk.vmware_deploy_ova
vmware_deploy_ova
This role allows you to import an OVA/OVF template to a VMware vCenter Server or VMware ESXi host.
Requirements
- Python version 2.6 or higher
- PyVmomi library
Role Variables
Default Variables (found in defaults/main.yml)
Set the source of the OVA file.
You can choose from 'local' or 'http':
- If you choose local, the OVA file will come from the specified ova_path.
- If you choose http, the OVA file will be downloaded to the specified ova_path. Make sure to also set the ova_url.
ova_source: "local"
Decide if certificate verification should be enabled for the target host where the OVA is imported.
ova_validate_certs: no
Set whether duplicates with the same name are allowed.
ova_allow_duplicates: no
Choose whether the appliance should power on after the OVA import is finished.
ova_power_on_after_deploy: yes
Decide if the module should wait for the IP address to become available in vCenter after powering on.
ova_wait_for_ip_address: no
Set the default disk format for the imported OVA's disks.
ova_deployment_disk_type: thin
Hardware Configuration
ova_hardware_hotadd_cpu_enabled: true
ova_hardware_hotadd_mem_enabled: true
Required Parameters (to be provided as extra vars, group_vars, or host_vars):
OVA Deployment Variables
Set the variables needed for OVA deployment.
ova_deployment_hostname: "vcenter/esxi hostname"
ova_deployment_username: "vcenter/esxi username"
ova_deployment_password: "vcenter/esxi password"
Specify the target datastore. Note that datastore clusters are not supported.
ova_deployment_datastore: "datastore"
The following parameters are only needed when deploying to vCenter Server. If not defined, the appliance will go to the default folder:
ova_deployment_datacenter: "vcenter datacenter"
ova_deployment_cluster: "vcenter cluster"
ova_deployment_folder: "vcenter folder"
Mandatory Global Variables
OVA Configuration
Set the name of the OVA file.
ova_file: "ova_file.ova"
Set the local path to the OVA file (do not start with a slash).
ova_path: "/path/to/ova_file"
Optional Global Variables
OVA Download Configuration
If using http, set the URL to the OVA file (do not start with a slash).
ova_url: "http[s]://example.com/ovas"
Mandatory Variables for Roles Using This Role
OVA Properties
A key-value pair for the network property.
ova_networks:
"key": "value"
Example:
ova_networks:
"Network 1": "label"
Set OVA properties as key-value pairs.
ova_properties:
"key": "value"
"key": "value"
Example:
ova_properties:
"guestinfo.cis.appliance.net.addr.family": "ipv4"
"guestinfo.cis.appliance.net.mode": "static"
Optional Variables for Roles Using This Role
Deployment options can also be specified.
ova_deployment_option: "option"
OVA vApp Properties
Set vApp Properties as a list of dictionaries, where userConfigurable
is set to true.
vapp_properties:
- id: guestinfo.cis.deployment.node.type
type: string
value: "embedded"
userConfigurable: true
- id: guestinfo.cis.appliance.ssh.enabled
type: boolean
value: "true"
userConfigurable: true
Hardware Configuration
Set the number of CPU sockets.
ova_hardware_num_cpus: 2
Set the amount of memory in GB.
ova_hardware_mem_gb: 6
Define the disks to add.
ova_hardware_disks:
- size_gb: 2
type: thin # Hard Disk 1
- size_gb: 4
type: thin # Hard Disk 2
Define the networks to add.
ova_hardware_networks:
- name: "network label" # nic 1
- name: "network label" # nic 2
Example Playbook
This role is intended to be used as a dependency for parent roles.
Deploy OVA/OVF template to VMware vCenter Server or VMware ESXi.
ansible-galaxy install simplygeekuk.vmware_deploy_ova