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'),