ansible/test/integration/targets/win_iis_webbinding/tasks/main.yml
Matt Martz 70b31abf85
Fix tests as filters 5 (#34406)
* Address recent tests as filters in win_iis_webbinding tests

* Make no-tests-as-filters.py so that it is executed
2018-01-03 12:10:24 -06:00

62 lines
1.9 KiB
YAML

---
# Cannot use win_feature to install IIS on Server 2008.
# Run a brief check and skip hosts that don't support
# that operation
#seems "raw" is the only module that works on 2008 non-r2. win_command and win_shell both failed
- name: register os version (seems integration tests don't gather this fact)
raw: powershell.exe "gwmi Win32_OperatingSystem | select -expand version"
register: os_version
changed_when: False
- block:
- include_tasks: setup.yml
- include_tasks: http.yml
- include_tasks: https-lt6.2.yml
when: os_version.stdout_lines[0] is version('6.2','lt')
- include_tasks: https-ge6.2.yml
when: os_version.stdout_lines[0] is version('6.2','ge')
- include_tasks: failures.yml
always:
- name: get all websites from server
raw: powershell.exe "(get-website).name"
register: existing_sites
- name: ensure all sites are removed for clean testing
win_iis_website:
name: "{{ item }}"
state: absent
with_items:
- "{{ existing_sites.stdout_lines }}"
- name: cleanup certreq files
win_file:
path: "{{ item }}"
state: absent
with_items:
- c:\windows\temp\certreq1.txt
- c:\windows\temp\certreq2.txt
- c:\windows\temp\certreqwc.txt
- c:\windows\temp\certreqresp1.txt
- c:\windows\temp\certreqresp2.txt
- c:\windows\temp\certreqrespwc.txt
- name: remove certs
raw: 'remove-item cert:\localmachine\my\{{ item }} -force -ea silentlycontinue'
with_items:
- "{{ thumbprint1.stdout_lines[0] }}"
- "{{ thumbprint2.stdout_lines[0] }}"
- "{{ thumbprint_wc.stdout_lines[0] }}"
- name: remove IIS features after test
win_feature:
name: Web-Server
state: absent
includ_sub_features: True
include_management_tools: True
register: feature_uninstall
- name: reboot after feature install
win_reboot:
when: feature_uninstall.reboot_required
when: os_version.stdout_lines[0] is version('6.1','gt')