Actually,
I am using ESXi evaluation mode (free). I created .yml file with the following entry:
---
- name: Create VM
vmware_guest:
hostname: esxilab
username: root
password: 123456
validate_certs: no
folder: /ha-datacenter/vm (I am not sure if it is correctly added)
name: testvm
state: poweredon
guest_id: centos64Guest
esxi_hostname: 192.168.1.101
disk:
- size_gb: 10
type: thin
datastore: datastore1
hardware:
memory_mb: 1024
num_cpus: 2
scsi: paravirtual
cdrom:
type: iso
iso_path: datastore1/iso files/CentOS-8.1.1911-x86_64-boot.iso
networks:
- name: VM Network
mac: 00:0c:29:c6:fe:93
ip: 192.168.1.105
netmask: 255.255.255.0
device_type: vmnic0
wait_for_ip_address: yes
delegate_to: localhost
register: deploy_vm
However, while running the file, I get the following error message:
ERROR! 'vmware_guest' is not a valid attribute for a Play
The error appears to be in '/home/ansible/projects/test/deploy_vm.yml': line 2, column 3, but may
be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
---
- name: Create VM
^ here