summaryrefslogtreecommitdiff
path: root/test/integration/targets/vmware_guest/tasks/mac_address_d1_c1_f0.yml
blob: 6e5a8d9217a567d2b8c8d09ee66434bdfd7dff56 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# 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 with manual MAC address
  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: 1
        memory_mb: 128
    disk:
        - size: 1gb
          type: thin
          datastore: "{{ rw_datastore }}"
    networks:
        - name: VM Network
          ip: 192.168.10.12
          netmask: 255.255.255.0
          gateway: 192.168.10.254
          mac: aa:bb:cc:dd:aa:42
    state: poweredoff
    folder: vm
  register: clone_d1_c1_f0

- debug: var=clone_d1_c1_f0

- name: assert that changes were made
  assert:
    that:
        - "clone_d1_c1_f0['instance']['hw_eth0']['addresstype'] == 'manual'"
        - "clone_d1_c1_f0['instance']['hw_eth0']['macaddress'] == 'aa:bb:cc:dd:aa:42'"