Monday, August 14, 2023

ansible-doc vmware.vmware_rest.vcenter_ovf_libraryitem

Under - deployment_spec section, Ansible-doc does not provide enough detail on `additional_parameters'  as displayed below:

- `additional_parameters' (list): Additional OVF parameters that may be needed for the deployment. Additional OVF parameters may be required by the OVF descriptor of the OVF package in the library item. Examples of OVF parameters that can be specified through this field include, but are not limited to:
  • {@link DeploymentOptionParams}
  • {@link ExtraConfigParams}
  • {@link IpAllocationParams}
  • {@link PropertyParams}
  • {@link ScaleOutParams}
  • {@link VcenterExtensionParams}

This causes vwmare_rest API call to deploy third-party OVF from content library very difficult to fill in all necessary properties in correct syntax.

Link below contains the class detail, but not syntax format. (I understand that a programmer will be able to figure it out)

https://vdc-repo.vmware.com/vmwb-repository/dcr-public/1cd28284-3b72-4885-9e31-d1c6d9e26686/71ef7304-a6c9-43b3-a3cd-868b2c236c81/doc/operations/com/vmware/vcenter/ovf/library_item.deploy-operation.html

https://vdc-repo.vmware.com/vmwb-repository/dcr-public/1cd28284-3b72-4885-9e31-d1c6d9e26686/71ef7304-a6c9-43b3-a3cd-868b2c236c81/doc/structures/com/vmware/vcenter/ovf/property-structure.html

https://vdc-download.vmware.com/vmwb-repository/dcr-public/4f867b1e-c524-4e4b-b79e-4321822b5c70/a3cd39a7-4eaf-4e10-9ad2-589f9dfe1f9a/doc/Com/Vmware/Vcenter/Ovf.html

Link below provide a quick way to get json format via vCenter API explorer. 

https://stackoverflow.com/questions/47912744/propertyparams-when-deploying-vm-from-ovf

Just convert it into yaml format for readability, then use it in Ansible playbook properly.

PS: deploy ovf from content library is much faster than from local ova/ovf file, if you need to deploy it into multiple VM instances, and one time upload is worthy.

Thursday, August 3, 2023

Ansible "module_stderr": "env: python: No such file or directory\n"

Recently I got the following error while running existing Ansible playbook, which run successfully before :

fatal: [localhost]: FAILED! => {"changed": false, "module_stderr": "env: python: No such file or directory\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 127}


Ansible complains about python not found. I am using Homebrew python.

which python

python: aliased to python3

which python3

/opt/homebrew/bin/python3


stackoverflow option 2 works for me
https://stackoverflow.com/questions/3655306/ubuntu-usr-bin-env-python-no-such-file-or-directory

Just create symbolic link for python, required by Ansible:

ln -s /opt/homebrew/bin/python3 /opt/homebrew/bin/python