Hi all,

I use ansible v2.3.

when I tried to create from vm template by using vmware_guest module,
I saw an internal error below;


PLAYBOOK: vm.yml
****************************************************************************************************************************************
1 plays in vm.yml

PLAY [localhost]
****************************************************************************************************************************************
META: ran handlers

TASK [create the VM]
************************************************************************************************************************************
task path: /home/vagrant/vmware_deploy/vm.yml:9
Using module file
/usr/local/ansible/lib/ansible/modules/cloud/vmware/vmware_guest.py
<localhost> ESTABLISH LOCAL CONNECTION FOR USER: vagrant
<localhost> EXEC /bin/sh -c 'echo ~ && sleep 0'
<localhost> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo
/home/vagrant/.ansible/tmp/ansible-tmp-1486952035.63-258723752885301
`" && echo ansible-tmp-1486952035.63-258723752885301="` echo
/home/vagrant/.ansible/tmp/ansible-tmp-1486952035.63-258723752885301
`" ) && sleep 0'
<localhost> PUT /tmp/tmpFVfBUg TO
/home/vagrant/.ansible/tmp/ansible-tmp-1486952035.63-258723752885301/vmware_guest.py
<localhost> EXEC /bin/sh -c 'chmod u+x
/home/vagrant/.ansible/tmp/ansible-tmp-1486952035.63-258723752885301/
/home/vagrant/.ansible/tmp/ansible-tmp-1486952035.63-258723752885301/vmware_guest.py
&& sleep 0'
<localhost> EXEC /bin/sh -c 'sudo -H -S -n -u root /bin/sh -c
'"'"'echo BECOME-SUCCESS-ixxjesnouwewkoeaywbpuqolwknoptby;
/usr/bin/python
/home/vagrant/.ansible/tmp/ansible-tmp-1486952035.63-258723752885301/vmware_guest.py;
rm -rf "/home/vagrant/.ansible/tmp/ansible-tmp-1486952035.63-258723752885301/"
> /dev/null 2>&1'"'"' && sleep 0'
fatal: [localhost]: FAILED! => {
    "changed": false,
    "failed": true,
    "msg": "Module alias error: internal error: required and default
are mutually exclusive for datacenter"
}
        to retry, use: --limit @/home/vagrant/vmware_deploy/vm.retry

PLAY RECAP 
**********************************************************************************************************************************************
localhost                  : ok=0    changed=0    unreachable=0    failed=1


How should I solve this please?


My playbook;

- hosts: localhost
  connection: local
  become: true
  become_user: root
  gather_facts: no

  tasks:
    # Create a VM from a template
    - name: create the VM
      vmware_guest:
        hostname: 192.168.0.11
        username: root
        password: vmware
        validate_certs: no
        esxi_hostname: 192.168.0.12
        datacenter: "TK"
        folder: MyMachines
        name: testvm_cent7_001
        state: poweredon
        guest_id: centos64guest
        disk:
        - size_gb: 10
          type: thin
          datastore: SSD-250
        hardware:
          memory_mb: 1024
          num_cpus: 2
          scsi: paravirtual
        networks:
        - name: VM Network
          ip: 192.168.0.25
          netmask: 255.255.255.0
          mac: 'aa:bb:dd:aa:00:14'
        template: "temp_centos7"
        wait_for_ip_address: yes


Best Regards,


Tk

-- 
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 post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAOpn5sQj7%3DcDRhzKXH94efeCpebZ5zUVVCDF0CnkyvKOweKQkw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to