# cannot get this playbook to work with inventory file

**URL:** <https://forum.ansible.com/t/cannot-get-this-playbook-to-work-with-inventory-file/30076>\
**Category:** Ansible Project\
**Tags:** vmware\
**Created:** [April 6, 2019, 8:48pm UTC](https://forum.ansible.com/t/cannot-get-this-playbook-to-work-with-inventory-file/30076 "2019-04-06T20:48:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tony\_Wong](https://avatars.discourse-cdn.com/v4/letter/t/3ab097/32.png) [@Tony\_Wong](https://forum.ansible.com/u/Tony_Wong)\
**Post date:** [April 6, 2019, 8:48pm UTC](https://forum.ansible.com/t/cannot-get-this-playbook-to-work-with-inventory-file/30076/1 "2019-04-06T20:48:36Z")

</div>

I am having an issue with ansible/vmware. Trying to clone vms from an inventory file and playbook

inventory file:

[test-vms]  
ans-test[01:05] ‘disk’=‘60’ ‘memory’=‘2048’ ‘cpucount’=‘1’ ‘datastore’=‘VOL1-TEST’ 'osid=‘windows9Server64Guest’

playbook yml file:

vars\_prompt:

- name: “vcenter\_hostname”  
prompt: “Enter vcenter hostname”  
private: no  
default: “vcsa”
- name: “vcenter\_user”  
prompt: “Enter vcenter username”  
private: no
- name: “vcenter\_pass”  
prompt: “Enter vcenter password”  
private: yes

vars:  
datacenter: ‘DC’’  
esxi\_host: ‘xxxxxxx’  
notes: ‘Created by Ansible’  
template: ‘2016STDx64\_Template’  
datastore: ‘VOL1-TEST’  
network: ‘vlan200’  
folder: ‘ansible’

tasks:

- vsphere\_guest:  
vcenter\_hostname: “{{ vcenter\_hostname }}”  
username: “{{ vcenter\_user }}”  
password: “{{ vcenter\_pass }}”  
guest: “{{ inventory\_hostname }}”  
validate\_certs: False  
from\_template: yes  
template\_src: “{{ template }}”

```auto
    vm_extra_config:
      folder: "{{ folder }}"
      notes: "{{ notes }}"
    vm_disk:
      disk1:
        size_gb: "{{ disk }}"
        type: thin
        datastore: "{{ datastore }}"
    vm_nic:
      nic1:
        type: vmxnet3
        network: "{{ network }}"
        network_type: standard
    vm_hardware:
      memory_mb: "{{ memory }}"
      num_cpus: "{{ cpucount }}"
      osid: "{{ osid }}"
      scsi: paravirtual
    esxi:
      datacenter: "{{ datacenter }}"
      hostname: "{{ esxi_host }}"

```

the playbook runs but the VMs asre not getting put in the right datastore. Also the memory is not set correctly at 2GB ram. vcpus is ok at 1

any idea?
