- name: Create a virtual machine on the ESXI host
      vmware_guest:
        hostname: "{{ vcenter_ip }}"
        username: "{{ vcenter_username }}"
        password: "{{ vcenter_password }}"
        validate_certs: no
        datacenter: "{{ datacenter }}"
        folder: /Datacenter/vm/
        #name: "my_vm_{{ item }}"
        name: test_vm_00
        guest_id: rhel7_64Guest
        state: poweredon
        datastore: "{{ datastore }}"
        esxi_hostname: "{{ esxhost }}"
        disk:
        - size_gb: 10
          type: thin
          datastore: "{{ datastore }}"
        hardware:
          memory_mb: 1024
          num_cpus: 2
          scsi: paravirtual
        cdrom:
        - type: iso
          iso_path: "{{ OS_ISO_path }}"
          controller_type: ide
          controller_number: 0
          unit_number: 0
          state: present
        - type: iso
          iso_path: "{{ kickstart iso_path }}"
          controller_type: ide
          controller_number: 0
          unit_number: 1
          state: present
        networks:
        - name: VM Network
          ip: "{{ ip_address }}"
          netmask: "{{ netmask }}"
          dns_servers:
          - ****
          start_connected: yes
        wait_for_ip_address: yes
        customization:
          dns_servers:
          - ****
          domain: ****
          #wait_for_customization: yes
        wait_for_ip_address: yes