i did something like that recently with Windows Server 2019.
Used module community.vmware.vmware_guest:
and under
     customization:
      hostname: '{{ vm.Name }}'

to run various commands and install agents i used
  community.vmware.vmware_vm_shell:
In my case the agents were already on the template.
But there is another module which will help you copy files to VM without
using network.
Hope that helps.

Abhi
On Wed, 29 Jun 2022 at 21:54, [email protected] <[email protected]>
wrote:

> Can you share the Ansible Script that you have, Are you using the
> customization parameter?
>
> Also, have you tried using some sort of Pipeline where you can run a
> second Script using Ansible.builtin.hostname
>
>
>
> On Wednesday, June 29, 2022 at 8:13:06 PM UTC+1 [email protected] wrote:
>
>> I was able to deploy VMs from a template and they get renamed but the
>> hostname doesn't actually get updated. I am still trying to figure out how
>> to do that but I have a bash script that I run on the VM, SUSE 15 Linux
>> server, which joins to a domain and adds to SUSE Manager. For the life of
>> me I cannot figure out what I need to add to my Ansible playbook so when
>> these VMs get deployed from the template the hostname gets updated with
>> what I configured and that script gets run with the appropriate switches.
>>
>> Any guidance or help would be appreciated.
>>
>> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/d2025661-3e06-4fc8-91ad-cd173b76b85fn%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/d2025661-3e06-4fc8-91ad-cd173b76b85fn%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CACRdtvuNSDmLwL79MvpUP%2BMiQ7HVtG8aynfQQTpM5vnDaLzggg%40mail.gmail.com.

Reply via email to