Internal error in vmware_guest (required and default are mutually exclusive for datacenter)

369 views
Skip to first unread message

Takeshi Kuramochi

unread,
Feb 12, 2017, 9:21:39 PM2/12/17
to ansible...@googlegroups.com
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

danie...@hertshtengroup.com

unread,
Feb 13, 2017, 9:07:13 AM2/13/17
to Ansible Project
https://github.com/ansible/ansible/commit/239c6aee35f3abcd52abf2c6497b75356002dd14

These changes appear to have broken the ability to deploy via this module. I am getting the following error after this commit:

fatal: [vm01]: FAILED! => {"changed": false, "failed": true, "msg": "Module alias error: internal error: required and default are mutually exclusive for datacenter"}

Backing out this change has restored functionality.


This e-mail is for the sole attention of the identified addressee(s). Access to this email by anyone else is unauthorised. The contents of this e-mail and any attachments are confidential and for informational purposes only and may be subject to legal privilege. If you are not the intended recipient or have received this e-mail in error, you must not copy, distribute, publish, rely on or otherwise use it without the sender’s consent.

Please delete this e-mail and any attachments immediately (without retaining any copies), notifying the sender by return e-mail. The sender makes no warranty or representation as to the accuracy and completeness of any information contained in this e-mail or attachments and does not accept liability for any errors or omissions.

This e-mail has originated from a member of the Hertshten Group Limited group of companies.

Takeshi Kuramochi

unread,
Feb 13, 2017, 9:50:33 AM2/13/17
to ansible...@googlegroups.com
Hello daniel,
Thank you.

I checked that comment.


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 ansible-proje...@googlegroups.com.
> To post to this group, send email to ansible...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/c2d1714a-c0e4-43ca-8013-797925b438c0%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages