vmware.vmware.import_content_library_ovf module – Import an OVF or OVA file to a content library from a remote source.
Note
This module is part of the vmware.vmware collection (version 1.11.0).
You might already have this collection installed if you are using the ansible
package.
It is not included in ansible-core
.
To check whether it is installed, run ansible-galaxy collection list
.
To install it, use: ansible-galaxy collection install vmware.vmware
.
To use it in a playbook, specify: vmware.vmware.import_content_library_ovf
.
Synopsis
Import an OVF or OVA library item from a remote source, such as a file on the Ansible host or a URL.
Source files should be OVAs or directories matching the OVF standard. OVF directories should contain an .ovf file and at least on .vmdk file.
This module manages the content library item, not the remote OVF/OVA. If state is absent, only the content library item will be affected.
Parameters
Parameter |
Comments |
---|---|
The checksum that should be used to validate the upload.
This is not used if the source is an OVF. In that case he local file size is used to validate the upload. |
|
The checksum algorithm to use when validating uploads. This is required if This is not used if the source is an OVF. In that case he local file size is used to validate the upload. Choices:
|
|
A description for the OVF item in the content library. |
|
The destination name of the OVF item in the content library. If an item with the same name already exists, the module will not update it. |
|
Cause the module to treat any warnings thrown during the file upload process as errors. Choices:
|
|
The hostname or IP address of the vSphere vCenter server. If the value is not specified in the task, the value of environment variable |
|
The ID of the library to search within. One of |
|
The name of the library to search within. One of |
|
The password of the vSphere vCenter server. If the value is not specified in the task, the value of environment variable |
|
The port number of the vSphere vCenter server. If the value is not specified in the task, the value of environment variable Default: |
|
The 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 |
|
The 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 |
|
The proxy connection protocol to use. This option is used if the correct proxy protocol cannot be automatically determined. Choices:
|
|
The source OVF or OVA file that should be imported to the content library. This can be a local path or a URL. If it is a local path, it should be a valid path on the Ansible host. If it is a URL, its scheme can be HTTPS, HTTP, or datastore (ds://). The file is acquired directly from the vCenter appliance. The module will not encode URLs for you. If this is a URL with special characters (like $ or ~), you should use the urlencode filter. Required when state is present. |
|
The SSL thumbprint of the source URL, if it uses HTTPS. This is ignored for other schemes. If this is not provided, whatever certificate is presented will be trusted. |
|
Controls if the OVF file should be present or absent in the content library. Choices:
|
|
The timeout period in seconds for uploads to complete. Default: |
|
The username of the vSphere vCenter server. If the value is not specified in the task, the value of environment variable |
|
Allows connection when SSL certificates are not valid. Set to If the value is not specified in the task, the value of environment variable Choices:
|
Attributes
Attribute |
Support |
Description |
---|---|---|
Support: full |
The check_mode support. |
Notes
Note
All modules require API write access and hence are not supported on a free ESXi license.
All variables and VMware object names are case sensitive.
Modules may rely on the ‘requests’ python library, which does not use the system certificate store by default. You can specify the certificate store by setting the REQUESTS_CA_BUNDLE environment variable. Example: ‘export REQUESTS_CA_BUNDLE=/path/to/your/ca_bundle.pem’
See Also
See also
- vmware.vmware.deploy_content_library_ovf
Deploy a virtual machine from an OVF in a content library.
Examples
- name: Acquire An OVA From A Url
vmware.vmware.import_content_library_ovf:
hostname: "https://vcenter"
username: "username"
password: "password"
src: "https://example.com/my/ova/file.ova"
dest: my_ova_file
library_name: MyContentLibrary
- name: Acquire An OVA From A Url With Special Chars
vmware.vmware.import_content_library_ovf:
hostname: "https://vcenter"
username: "username"
password: "password"
src: "{{ 'https://example.com/$my$/ova/file.ova' | urlencode }}"
dest: my_ova_file
library_name: MyContentLibrary
- name: Upload an OVF From The Ansible Host
vmware.vmware.import_content_library_ovf:
hostname: "https://vcenter"
username: "username"
password: "password"
library_id: "{{ my_library.id }}"
src: /opt/ovfs/my_ovf
dest: my_ovf_file
- name: Delete an OVF
vmware.vmware.import_content_library_ovf:
hostname: "https://vcenter"
username: "username"
password: "password"
state: absent
library_id: "{{ my_library.id }}"
dest: my_ovf_file