From 9b138fe8aa5adf0997bcc1297be81ef05e720e7e Mon Sep 17 00:00:00 2001 From: Alexander Nikitin Date: Sun, 12 Jan 2025 18:01:07 +0300 Subject: [PATCH] add new spec param #2275 (#2276) SUMMARY Add new customization spec param https://dp-downloads.broadcom.com/api-content/apis/API_VWSA_001/8.0U3/html/ReferenceGuides/vim.vm.customization.Identification.html Fixes #2275 ISSUE TYPE Feature Pull Request COMPONENT NAME vmware_guest Reviewed-by: Mario Lenz --- changelogs/fragments/2275-vm-ou-customization.yml | 3 +++ plugins/modules/vmware_guest.py | 10 ++++++++++ 2 files changed, 13 insertions(+) create mode 100644 changelogs/fragments/2275-vm-ou-customization.yml diff --git a/changelogs/fragments/2275-vm-ou-customization.yml b/changelogs/fragments/2275-vm-ou-customization.yml new file mode 100644 index 000000000..da5506ed7 --- /dev/null +++ b/changelogs/fragments/2275-vm-ou-customization.yml @@ -0,0 +1,3 @@ +minor_changes: + - vmware_guest - Add new cutomization spec param `domainOU`. + (https://github.com/ansible-collections/community.vmware/issues/2275) \ No newline at end of file diff --git a/plugins/modules/vmware_guest.py b/plugins/modules/vmware_guest.py index 346374c63..1723df058 100644 --- a/plugins/modules/vmware_guest.py +++ b/plugins/modules/vmware_guest.py @@ -753,6 +753,12 @@ description: - List of commands to run at first user logon. - Specific to Windows customization. + domain_ou: + type: str + description: + - The full LDAP path name of the OU to which the computer belongs. + - Specific to Windows customization. + - Work for vSphere 8.0U2 and above type: dict default: {} vapp_properties: @@ -2360,6 +2366,9 @@ def customize_vm(self, vm_obj): ident.identification.domainAdminPassword.value = self.params['customization']['domainadminpassword'] ident.identification.domainAdminPassword.plainText = True + # Add new spec param for vSphere 8.0U2 + ident.identification.domainOU = self.params['customization']['domain_ou'] + elif self.params['customization']['joinworkgroup'] is not None: ident.identification.joinWorkgroup = self.params['customization']['joinworkgroup'] @@ -3522,6 +3531,7 @@ def main(): domain=dict(type='str'), domainadmin=dict(type='str'), domainadminpassword=dict(type='str', no_log=True), + domain_ou=dict(type='str'), existing_vm=dict(type='bool'), fullname=dict(type='str'), hostname=dict(type='str'),