community.vmware icon indicating copy to clipboard operation
community.vmware copied to clipboard

vmware_content_deploy_ovf_template: enable injection of ovf env like in vmware_deploy_ovf

Open mbx64 opened this issue 1 year ago • 1 comments

SUMMARY

I can use vmware_deploy_ovf to deploy a VM from an OVF file on my ansible controller or from an OVF file on a HTTP server. This way, I can fully customize the template using the inject_ovf_env and properties arguments. But this module always requires the transfer of the OVF file for each VM. Therefore, I would like to use vmware_content_deploy_ovf_template to deploy from an already existing OVF file in the content library. But vmware_content_deploy_ovf_template does not allow the injection of an OVF env and therefore I cannot customize the deployment.

It would be nice to have the same inject_ovf_env feature like in vmware_deploy_ovf.

ISSUE TYPE
  • Feature Idea
COMPONENT NAME

vmware_content_deploy_ovf_template

ADDITIONAL INFORMATION
- name: Deploy Virtual Machine from OVF template in content library
  community.vmware.vmware_content_deploy_ovf_template:
    hostname: '{{ vcenter_hostname }}'
    username: '{{ vcenter_username }}'
    password: '{{ vcenter_password }}'
    ovf_template: HAProxy
    datastore: Shared_NFS_Volume
    folder: vm
    datacenter: Sample_DC_1
    name: Sample_VM
    inject_ovf_env: true
    properties:
      appliance.root_pwd: YouGetTheIdea
  delegate_to: localhost

mbx64 avatar Jan 31 '24 17:01 mbx64

Unlike the deploy_ovf module, the vmware_content_deploy_ovf_template module uses the Rest API. The deploy method for LibraryItem accepts a block in deployment_spec additional_parameters, but the format of this block is not clear to me, and additional research is needed on how to prepare data for use there.

Otherwise, implementation of this feature does not look complicated.

ihumster avatar Jan 31 '24 17:01 ihumster