Hi All,

   Sorry i mixed up the results from two different tests...i ran another 
test and made sure the datacenter parameter matched the entry i made in 
/etc/hosts(vms01.acme.com), but i still got the same result.




On Thursday, May 5, 2016 at 9:35:32 PM UTC+8, Albert Uy wrote:
>
> Hi All,
>
>       Any suggestions on what to set the datacenter: parameter to?
>
>       i have an ESXi 6.0 whitebox at home, and am running Ansible 2.2.0 on 
> an Ubuntu 16.04 vm. i've tried setting the datacenter: parameter to the 
> hostname/ip of the whitebox, but i still end up getting this(i've added an 
> entry in /etc/hosts for vms01.auy.com, and have verified that i can 
> resolve it):
>
>
>
> ############################################################################################################################################
>  ./ansible-playbook esx.yml
>
> PLAY [test] 
> ********************************************************************
>
> TASK [vsphere_guest] 
> ***********************************************************
> fatal: [127.0.0.1]: FAILED! => {"changed": false, "failed": true, "msg": 
> "Cannot find datacenter named: vms01.auy.com"}
>
> NO MORE HOSTS LEFT 
> *************************************************************
>         to retry, use: --limit @/home/auy/test/esx.retry
>
> PLAY RECAP 
> *********************************************************************
> 127.0.0.1                  : ok=0    changed=0    unreachable=0    failed=1
>
>
> ############################################################################################################################################
>
>
>
>
>       i am running the ff playbook(i just added an entry in  /etc/hosts 
> file for *vms01.acme.com <http://vms01.acme.com> *):
>
>
>
> ############################################################################################################################################
>
> ---
> - name: test
>   hosts: 127.0.0.1
>   connection: local
>   #user: root
>   #sudo: false
>   gather_facts: false
>   serial: 1
>
>   tasks:
>   - vsphere_guest:
>        vcenter_hostname: vms01.acme.com
>        validate_certs: no
>        username: root
>        password: passwordispassword
>        #power_on_after_clone: no
>        guest: test-vm
>        vm_hardware:
>           memory_mb: 1024
>           num_cpus: 1
>           osid: centos64Guest
>           scsi: paravirtual
>        vm_disk:
>           disk1:
>             size_gb: 10
>             type: thin
>             datastore: datastore1
>             folder: /vmfs/volumes/datastore1/test-vm
>        vm_nic:
>           nic1:
>             type: vmxnet3
>             network: VM network
>             network_type: standard
>        esxi:
> *          datacenter: vms01.acme.com <http://vms01.acme.com>*
> *          hostname: vms01.acme.com <http://vms01.acme.com>*
> ...
>
> ############################################################################################################################################
>
>
> tia
>
>
>
>
>
>

-- 
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/97b981bc-667a-4e22-a7f0-a0bbb5ee8ec7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to