Skip to content

Commit

Permalink
vmware_deploy_ovf: Add option to source properties marked as ovf:user… (
Browse files Browse the repository at this point in the history
#1838) (#1883)

vmware_deploy_ovf: Add new parameter enable_hidden_properties

SUMMARY
This forces OVF properties marked as ovf:userConfigurable=false to become user configurable.
This is useful when deploying VCSA OVAs.
ISSUE TYPE

Feature Pull Request

COMPONENT NAME
vmware_deploy_ovf
ADDITIONAL INFORMATION
Backport #1838
  • Loading branch information
mariolenz authored Oct 17, 2023
1 parent c85398d commit ff98f59
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
3 changes: 3 additions & 0 deletions changelogs/fragments/802-vmware_deploy_ovf.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
minor_changes:
- vmware_deploy_ovf - New parameter enable_hidden_properties to force OVF properties marked as ovf:userConfigurable=false to become user configurable
(https://github.com/ansible-collections/community.vmware/issues/802).
14 changes: 14 additions & 0 deletions plugins/modules/vmware_deploy_ovf.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,12 @@
description:
- Disk provisioning type.
type: str
enable_hidden_properties:
description:
- Enable source properties that are marked as ovf:userConfigurable=false
default: false
version_added: '3.11.0'
type: bool
fail_on_spec_warnings:
description:
- Cause the module to treat OVF Import Spec warnings as errors.
Expand Down Expand Up @@ -596,6 +602,10 @@ def get_lease(self):
spec_params
)

if self.params['enable_hidden_properties']:
for prop in self.import_spec.importSpec.configSpec.vAppConfig.property:
prop.info.userConfigurable = True

errors = [to_native(e.msg) for e in getattr(self.import_spec, 'error', [])]
if self.params['fail_on_spec_warnings']:
errors.extend(
Expand Down Expand Up @@ -860,6 +870,10 @@ def main():
],
'default': 'thin',
},
'enable_hidden_properties': {
'default': False,
'type': 'bool',
},
'power_on': {
'type': 'bool',
'default': True,
Expand Down

0 comments on commit ff98f59

Please sign in to comment.