Hello,

I new user with Ansible ,  I use this Playbook , but how can i change the 
Linux guest vm after cloning . when i clone the vm machine i get the same 
host name . i would like to use the name in the *host.vms* file .

Thank You , 

this is my playbook

#>  ansible-playbook -i hosts.vms clone_playbook.yml

*host.vms*
[vmcreate]
mfp-svt-trial77  datastore='Qa-DataStore' network='NET-10.100.227.0/25'

*clone_playbook.yml *
---
- hosts: vmcreate
  gather_facts: false
  connection: local
  user: remote
  sudo: true

  vars:
    vcenter_hostname: 'wl-manager01.mydomain.com'
    vcenter_user: 'dan...@maydomain.com'
    vcenter_pass: 'mypassword'
    datacenter: 'MFP-DOM'
    esxi_host: 'wl-esxi510-qa.mydomain.com'
    folder: 'SVT-Automation'
    notes: 'Created by Ansible'

  tasks:
    - vsphere_guest:
        vcenter_hostname: "{{ vcenter_hostname }}"
        username: "{{ vcenter_user }}"
        password: "{{ vcenter_pass }}"
        guest: "{{ inventory_hostname }}"
        from_template: yes
        template_src: mfp-vm-basic
        cluster: mfp
        validate_certs: no
        vm_extra_config:
          notes: "{{ notes }}"
          folder: "{{ folder }}"
        esxi:
          datacenter: "{{ datacenter }}"
          hostname: "{{ esxi_host }}"

-- 
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/9ab3b687-d96d-4cde-b8c5-5c3baae4381c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to