summaryrefslogtreecommitdiff
path: root/test/integration/targets/vmware_guest/tasks/windows_vbs_d1_c1_f0.yml
blob: 88a5757bf1d495d59f54b052eec1122e9c9fc46b (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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
- name: Create Windows 10 VM with VBS enabled
  vmware_guest:
    validate_certs: False
    hostname: "{{ vcenter_hostname }}"
    username: "{{ vcenter_username }}"
    password: "{{ vcenter_password }}"
    folder: "{{ f0 }}"
    name: vbs-Test
    datacenter: "{{ dc1 }}"
    cluster: "{{ ccr1 }}"
    resource_pool: Resources
    guest_id: windows9_64Guest
    hardware:
      memory_mb: 128
      num_cpus: 1
      virt_based_security: True
      version: 14
      boot_firmware: efi
      scsi: paravirtual
    disk:
    - size_mb: 128
      type: thin
      datastore: '{{ rw_datastore }}'
    cdrom:
      type: client
  register: vbs_vm

- debug: var=vbs_vm

- name: assert the VM was created
  assert:
    that:
      - "vbs_vm.failed == false"
      - "vbs_vm.changed == true"

- name: Create Windows Server 2016 VM without VBS enabled
  vmware_guest:
    validate_certs: False
    hostname: "{{ vcenter_hostname }}"
    username: "{{ vcenter_username }}"
    password: "{{ vcenter_password }}"
    folder: "{{ f0 }}"
    name: vbs-Test2
    datacenter: "{{ dc1 }}"
    cluster: "{{ ccr1 }}"
    resource_pool: Resources
    guest_id: windows9Server64Guest
    hardware:
      memory_mb: 128
      num_cpus: 1
      version: 14
      boot_firmware: efi
      scsi: paravirtual
    disk:
    - size_mb: 128
      type: thin
      datastore: '{{ rw_datastore }}'
    cdrom:
      type: client
  register: vbs_vm

- debug: var=vbs_vm

- name: assert the VM was created
  assert:
    that:
      - "vbs_vm.failed == false"
      - "vbs_vm.changed == true"

- name: Enable VBS for Windows Server 2016 VM
  vmware_guest:
    validate_certs: False
    hostname: "{{ vcenter_hostname }}"
    username: "{{ vcenter_username }}"
    password: "{{ vcenter_password }}"
    folder: "{{ f0 }}"
    name: vbs-Test2
    datacenter: "{{ f0 }}"
    disk:
    - size_mb: 256
      type: thin
      datastore: '{{ rw_datastore }}'
    hardware:
      virt_based_security: True
    state: present
  register: vbs_vm

- debug: var=vbs_vm

- name: assert the VM was changed
  assert:
    that:
      - vbs_vm is changed