VMware vSphere

 View Only
  • 1.  Ansible VM Guest Customization

    Posted Oct 23, 2019 08:44 PM

    So I wrote a playbook that builds a VM and configures etc. and it works great. I use the customization piece in the vmware_guest module for ansible that joins it to the domain but I'm looking to get the VM added to a specific OU. Asking here because I've tried to use the runonce command but those all want to use the netdom command, which doesnt exist by default on server 2019. Curious if/how others are doing this? I've looked into the ansible module for windows but I dont want to have a windows bridge computer.



  • 2.  RE: Ansible VM Guest Customization

    Posted Oct 23, 2019 09:21 PM

    I figured it out...

    the ansible module uses the same thing sysprep uses.In this case the MachineObjectOU is the parameter you can add. Its not on any ansible documentation either.

    customization:

         domainadmin: "{{ joinDomainUser }}"

         domainadminpassword: "{{ joinDomainPassword }}"

         joindomain: "{{ joinDomainName }}"

         MachineObjectOU: "{{ domainOuPath }}"



  • 3.  RE: Ansible VM Guest Customization

    Posted Oct 23, 2019 09:43 PM

    Nevermind. I never deleted the old computer account in AD. Thats not the fix, unfortunately



  • 4.  RE: Ansible VM Guest Customization

    Posted Jun 17, 2020 03:11 PM

    were you able to get a vm clone to join a particular machine OU with

    machineobjectou in ansible customization?

    I am trying the same thing and it doesnt do it. It joins the domain but keeps putting it in computer objects OU



  • 5.  RE: Ansible VM Guest Customization

    Posted Dec 07, 2022 05:41 PM

    Were you able to solve the issue?

    I'm having the same problem.