nmshadey.vmware_deploy_ova
VMware Deploy OVA Role
Overview
This role lets you import an OVA/OVF template into a VMware vCenter Server or an ESXi host.
Requirements
- Python version 2.6 or higher
- PyVmomi Library
Role Variables
Default Settings (from defaults/main.yml)
ova_source: Choose where to get the OVA file:
local
: Use a file from your system (set by ova_path).http
: Download the file (set by ova_url).
Example:
ova_source: "local"
ova_validate_certs: Enable certificate validation when importing the OVA.
ova_validate_certs: no
ova_allow_duplicates: Allow multiple OVA imports with the same name.
ova_allow_duplicates: no
ova_power_on_after_deploy: Power on the appliance after import.
ova_power_on_after_deploy: yes
ova_wait_for_ip_address: Wait for the IP address to show up in vCenter after powering on the OVA.
ova_wait_for_ip_address: no
ova_deployment_disk_type: Default disk format for the OVA.
ova_deployment_disk_type: thin
Hardware Configurations:
ova_hardware_hotadd_cpu_enabled: true ova_hardware_hotadd_mem_enabled: true
Required Parameters (Set as extra vars, group_vars, or host_vars)
OVA Deployment Variables:
ova_deployment_hostname: "vcenter/esxi hostname" ova_deployment_username: "vcenter/esxi username" ova_deployment_password: "vcenter/esxi password"
Target Datastore (datastore clusters are not supported):
ova_deployment_datastore: "datastore"
Additional vCenter Server Configurations (if required):
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"
Specify the local path to the OVA file (no leading /):
ova_path: "/path/to/ova_file"
Optional Global Variables
- OVA Download Configuration:
URL for the OVA file (if source is 'http', no leading /):
ova_url: "http[s]://example.com/ovas"
Mandatory Variables for Roles Using This Role
OVA Properties: Define network properties:
ova_networks: "key": "value"
Example:
ova_networks: "Network 1": "label"
Define additional OVA properties:
ova_properties: "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 Option:
ova_deployment_option: "option"
OVA vApp Properties: List of dictionaries with user-configurable properties:
vapp_properties: - id: guestinfo.cis.deployment.node.type type: string value: "embedded" userConfigurable: true
Hardware Configuration
Number of CPU sockets:
ova_hardware_num_cpus: 2
Amount of memory (in GB):
ova_hardware_mem_gb: 6
Define disks to add:
ova_hardware_disks: - size_gb: 2 type: thin # Hard Disk 1 - size_gb: 4 type: thin # Hard Disk 2
Define networks to add:
ova_hardware_networks: - name: "network label" # nic 1 - name: "network label" # nic 2
Example Playbook
This role is meant to be used alongside higher-level roles.