Debian Codegraph @

ansible_collections/community/windows/tests/integration/targets/win_iis_webapppool/tasks/main.yml

raw
1 ---
2 # Cannot use win_feature to install IIS on Server 2008.
3 # Run a brief check and skip hosts that don't support
4 # that operation
5 - name: check if win_feature will work on test host
6 ansible.windows.win_command: powershell.exe "Get-WindowsFeature"
7 register: module_available
8 failed_when: False
9
10 # Run actual tests
11 - block:
12 - name: ensure IIS features are installed
13 ansible.windows.win_feature:
14 name: Web-Server
15 state: present
16 include_management_tools: True
17 register: feature_install
18
19 - name: reboot after feature install
20 ansible.windows.win_reboot:
21 when: feature_install.reboot_required
22
23 - name: set version of IIS for tests
24 win_file_version:
25 path: C:\Windows\System32\inetsrv\w3wp.exe
26 register: iis_version
27
28 - name: ensure test pool is deleted as a baseline
29 win_iis_webapppool:
30 name: '{{test_iis_webapppool_name}}'
31 state: absent
32
33 # Tests
34 - name: run tests on hosts that support it
35 include_tasks: tests.yml
36
37 always:
38 # Cleanup
39 - name: ensure test pool is deleted
40 win_iis_webapppool:
41 name: '{{test_iis_webapppool_name}}'
42 state: absent
43 when: module_available.rc == 0