Getting error in deploying VMs using Ansible vsphere_guest module

551 views
Skip to first unread message

jnit...@gmail.com

unread,
Feb 12, 2015, 6:56:43 AM2/12/15
to ansible...@googlegroups.com
I am getting below error while using Ansible (version 1.8.2) vSphere_guest module,

osboxes@osboxes:~$ ansible-playbook /etc/ansible/playbooks/main.yml -K
sudo password:

PLAY [localhost] **************************************************************

TASK: [vsphere_guest ] ********************************************************
failed: [localhost] => {"failed": true, "parsed": false}
SUDO-SUCCESS-ldmjglnajxpocoybboumisekhbbnmhnp
Traceback (most recent call last):
  File "/home/osboxes/.ansible/tmp/ansible-tmp-1423728228.54-220175308723408/vsphere_guest", line 2791, in <module>
    main()
  File "/home/osboxes/.ansible/tmp/ansible-tmp-1423728228.54-220175308723408/vsphere_guest", line 1197, in main
    config_check("vm_disk", vm_disk, proto_vm_disk, module)
  File "/home/osboxes/.ansible/tmp/ansible-tmp-1423728228.54-220175308723408/vsphere_guest", line 1012, in config_check
    if diff.recursive_diff():
  File "/home/osboxes/.ansible/tmp/ansible-tmp-1423728228.54-220175308723408/vsphere_guest", line 983, in recursive_diff
    if k in self.check_dict[key]:
TypeError: argument of type 'NoneType' is not iterable


FATAL: all hosts have already failed -- aborting

PLAY RECAP ********************************************************************
           to retry, use: --limit @/home/osboxes/main.retry

localhost                  : ok=0    changed=0    unreachable=0    failed=1

Did anybody face this issue before? It may be, I am doing some silly mistake but unable to catch that.

Thanks

Giovanni Tirloni

unread,
Feb 12, 2015, 8:26:15 PM2/12/15
to ansible...@googlegroups.com
Please share the task definition (without confidential data).

Giovanni

jnit...@gmail.com

unread,
Feb 13, 2015, 4:50:27 AM2/13/15
to ansible...@googlegroups.com
Hi,

Below is yml am using,

---
- hosts: 127.0.0.1
  connection: local
  user: osboxes
  sudo: false
  gather_facts: false
  serial: 1

  tasks:
  - vsphere_guest:
      vcenter_hostname: xxx
      username: xxxxxx
      password: xxxxx
      guest: testansible
      state: powered_on
      vm_disk:
        disk1:
        size_gb: 1
        type: thin
        datastore: compute
      vm_nic:
        nic1:
        type: vmxnet3
        network: vm
        network_type: standard
      vm_hardware:
        memory_mb: 1024
        num_cpus: 1
        osid: centos64Guest
        scsi: paravirtual
      esxi:
        datacenter: xxx
    hostname: xxxxx

Thanks,

Giovanni Tirloni

unread,
Feb 13, 2015, 5:11:41 AM2/13/15
to ansible...@googlegroups.com
On Fri, 13 Feb 2015 01:50 -0800, jnit...@gmail.com wrote:
> Hi,
>
> Below is yml am using,
>
> ---
> - hosts: 127.0.0.1
> connection: local
> user: osboxes
> sudo: false
> gather_facts: false
> serial: 1
>
> tasks:
> - vsphere_guest:
> vcenter_hostname: xxx
> username: xxxxxx
> password: xxxxx
> guest: testansible
> state: powered_on
> vm_disk:
> disk1:
> size_gb: 1
> type: thin
> datastore: compute

I think you need to fix the indentation:

vm_disk:
disk1:
size_gb: 1
type: thin
datastore: compute


http://yaml.org/spec/current.html#id2519916

Giovanni

Daniel

unread,
Feb 13, 2015, 10:19:17 AM2/13/15
to ansible...@googlegroups.com
Can you post the vsphere_guest task that's failing? I can't pick it exactly from that error but we use it a fair bit so can at least have a gander for any of the things we tripped up on while figuring it out.

Cheers,
Daniel

--
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/9778e1a1-fd63-4691-ad7d-41b081e27266%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Mark Phillips

unread,
Feb 14, 2015, 5:25:27 AM2/14/15
to ansible...@googlegroups.com
You might be getting bitten by something I fixed in December...


Does it do the same if you use the devel branch?

jnit...@gmail.com

unread,
Feb 15, 2015, 1:02:54 AM2/15/15
to ansible...@googlegroups.com
Thank you Giovanni!! That solved the problem.

-Nitin

jnit...@gmail.com

unread,
Feb 15, 2015, 1:06:00 AM2/15/15
to ansible...@googlegroups.com
Thanks Mark, Daniel. That was the yml issue.
Reply all
Reply to author
Forward
0 new messages