# Test code for the vmware_guest module.
# Copyright: (c) 2017, Abhijeet Kasurde <akasurde@redhat.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)

- name: create new VMs
  vmware_guest:
    validate_certs: False
    hostname: "{{ vcenter_hostname }}"
    username: "{{ vcenter_username }}"
    password: "{{ vcenter_password }}"
    name: test_vm1
    guest_id: centos64Guest
    datacenter: "{{ dc1 }}"
    hardware:
        num_cpus: 4
        memory_mb: 512
    disk:
        - size: 1gb
          type: thin
          autoselect_datastore: True
    networks:
        - name: 'VM Network'
          device_type: vmxnet3
          ip: 192.168.10.1
          netmask: 255.255.255.0
          wake_on_lan: True
          start_connected: True
          allow_guest_control: True
    state: poweredoff
    folder: F0
  register: clone_d1_c1_f0

- debug: var=clone_d1_c1_f0

- name: assert that changes were made
  assert:
    that:
        - clone_d1_c1_f0 is changed
