Failed when using vmware_guest

44 views
Skip to first unread message

Rico John

unread,
Feb 23, 2017, 11:57:13 AM2/23/17
to Ansible Project
Hi,

I have tried using ansible for vcenter management. I have follow the tutorial, however it doesn't work. Please take a look at below :


root@ansible02:/etc/ansible# ansible-playbook test.yml -C

PLAY [vcenter] *****************************************************************

TASK [setup] *******************************************************************
ok: [vcenter]

TASK [create the VM] ***********************************************************
fatal: [vcenter]: FAILED! => {"changed": false, "failed": true, "msg": "pyvmomi module required"}
        to retry, use: --limit @/etc/ansible/test.retry

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


Here is my test.yml


---
- hosts: vcenter
  tasks:
   - name: create the VM
#    module: vmware_guest
     vmware_guest:
      hostname: 172.16.45.41
      username: root
      password: SharpEar!
      validate_certs: no
      esxi_hostname: 172.16.45.14
      datacenter: IDC
      name: testvm_2
      state: poweredoff
      disk:
      - size_gb: 20
        type: thin
        datastore: datastore_vm01
      hardware:
        memory_mb: 512
        num_cpus: 1
        scsi: paravirtual
        vm_nic:
          nic1:
            type: vmxnet3
            network: VM Network
            network_type: standard
      wait_for_ip_address: yes


I have tried with pyvmomi latest version & pyvmomi version 5.5 too. Same error.

Does anyone have any idea on this ?

Thank you.

Reply all
Reply to author
Forward
0 new messages