summaryrefslogtreecommitdiff
path: root/test/integration/targets/win_data_deduplication/tasks/pre_test.yml
blob: f72955e46bf9a898f9931ce078e400868399b7cf (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
---
- set_fact:
    AnsibleVhdx: '{{ remote_tmp_dir }}\AnsiblePart.vhdx'

- name: Install FS-Data-Deduplication
  win_feature:
    name: FS-Data-Deduplication
    include_sub_features: true
    state: present
  register: data_dedup_feat_reg

- name: Reboot windows after the feature has been installed
  win_reboot:
    reboot_timeout: 3600
  when:
    - data_dedup_feat_reg.success
    - data_dedup_feat_reg.reboot_required

- name: Copy VHDX scripts
  win_template:
    src: "{{ item.src }}"
    dest: '{{ remote_tmp_dir }}\{{ item.dest }}'
  loop:
    - { src: partition_creation_script.j2, dest: partition_creation_script.txt }
    - { src: partition_deletion_script.j2, dest: partition_deletion_script.txt }

- name: Create partition
  win_command: diskpart.exe /s {{ remote_tmp_dir }}\partition_creation_script.txt

- name: Format T with NTFS
  win_format:
    drive_letter: T
    file_system: ntfs

- name: Run tests
  block:
    - include: tests.yml
  always:
    - name: Detach disk
      win_command: diskpart.exe /s {{ remote_tmp_dir }}\partition_deletion_script.txt