Hi Everyone,

I would like to close this issue, as it is resolved. 

On Thursday, February 8, 2018 at 4:09:30 PM UTC+5:30, Ajay Sharma wrote:
>
>
> <https://lh3.googleusercontent.com/-1Ssrcmsjhp0/Wnwn3QoHRHI/AAAAAAAAAD8/DaNnDjBJmtkfel6xWETmISCI7bK-u-yXgCLcBGAs/s1600/vmware_guest.JPG>
> HI Everyone. this Ansible yaml script creates vmware vm from previous 
> template, but does not changes its host name.  also creates a additional 
> folder named 
>
> here is the screen shot attached. The vmware_guest module creates 
> Testmachine, but the hostname of the machine remains same when i login to 
> centos machine. 
>
> also creates a junk folder named as  
> "replica-e040a406-2f24-4c53-b719-67f42c1b9115"
>
> Thanks in Advance. please give some solution. here is my yaml script 
> attached. 
>
>
> <https://lh3.googleusercontent.com/-1Ssrcmsjhp0/Wnwn3QoHRHI/AAAAAAAAAD8/DaNnDjBJmtkfel6xWETmISCI7bK-u-yXgCLcBGAs/s1600/vmware_guest.JPG>
> cat us_vm.yaml
> ---
> - name: Deploy VM on 172.XX.X.XXX
>   hosts: localhost
>   gather_facts: no
>   vars_prompt:
>   - name: templatename
>     prompt: Supply template name
>     default: "CENTOS7-ENT-WWW-APACHE-DEFAULT"
>     private: no
>
>   - name: vm_name
>     prompt: Supply VM Name to Be Created
>     default: "TestMachine"
>     private: no
>   tasks:
>     - name: Create a VM from USA template
>       vmware_guest:
>         hostname: 172.17.X.XXX
>         username: XXXX\XXXXX
>         password: XXXXd1
>         datacenter: OSC-US-Datacenter-Other
>         validate_certs: no
>         folder: /VMwareViewComposerReplicaFolder
>         name: "{{vm_name}}"
>         state: poweredon
>         template: "{{templatename}}"
>         disk:
>           - size_gb: 50
>             type: thin
>             datastore: 3PAR_Datastore01
>         hardware:
>           memory_mb: 512
>           num_cpus: 1
>           scsi: paravirtual
>         networks:
>           - name: "OSC VLAN 4 172.16.9.0"
>             type: dhcp
>         customization:
> #         dns_servers:
> #         - 172.16.XX.XX
> #         - 172.16.XX.XX
>          dns_suffix: XXXX.XXXXXield.com
>          hostname: "{{vm_name}}"
>         wait_for_ip_address: no
>       delegate_to: localhost
>       register: deploy
> [root@OSIANSIBLEIND instance]#
>
>

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/f39d2ffe-5560-47b7-b7aa-318c29731c5d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to