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 }}”
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?