2017-11-06 00:44:04 +01:00
|
|
|
---
|
|
|
|
- name: get powershell version
|
|
|
|
win_shell: $PSVersionTable.PSVersion.Major
|
|
|
|
register: powershell_version
|
|
|
|
|
|
|
|
- name: run smoke tests when we can't run the full suite
|
|
|
|
include_tasks: smoke.yml
|
|
|
|
when: powershell_version.stdout_lines[0]|int < 5
|
|
|
|
|
|
|
|
- block:
|
|
|
|
- name: run non-destructive tests
|
|
|
|
include_tasks: tests.yml
|
|
|
|
|
|
|
|
- name: run destructive tests if flag is set
|
|
|
|
include_tasks: destructive.yml
|
|
|
|
when: test_win_dsc_run_desctructive == True
|
|
|
|
|
|
|
|
always:
|
|
|
|
- name: remove test feature
|
|
|
|
win_feature:
|
|
|
|
name: '{{test_win_dsc_feature_name}}'
|
|
|
|
state: absent
|
|
|
|
|
|
|
|
- name: remove test folder
|
|
|
|
win_file:
|
|
|
|
path: '{{test_win_dsc_folder}}'
|
|
|
|
state: absent
|
|
|
|
|
|
|
|
- name: remove custom DSC resource folder
|
|
|
|
win_file:
|
|
|
|
path: C:\Program Files\WindowsPowerShell\Modules\xTestDsc
|
|
|
|
state: absent
|
|
|
|
|
|
|
|
when: powershell_version.stdout_lines[0]|int >= 5
|