Debian Codegraph @

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

raw
1 ---
2 - block:
3 - include_tasks: setup.yml
4 - include_tasks: http.yml
5 - include_tasks: https-ge6.2.yml
6 - include_tasks: failures.yml
7
8 always:
9 - name: get all websites from server
10 raw: powershell.exe "(get-website).name"
11 register: existing_sites
12
13 - name: ensure all sites are removed for clean testing
14 win_iis_website:
15 name: "{{ item }}"
16 state: absent
17 with_items:
18 - "{{ existing_sites.stdout_lines }}"
19
20 - name: cleanup certreq files
21 ansible.windows.win_file:
22 path: "{{ item }}"
23 state: absent
24 with_items:
25 - c:\windows\temp\certreq1.txt
26 - c:\windows\temp\certreq2.txt
27 - c:\windows\temp\certreqwc.txt
28 - c:\windows\temp\certreqresp1.txt
29 - c:\windows\temp\certreqresp2.txt
30 - c:\windows\temp\certreqrespwc.txt
31
32 - name: remove certs
33 raw: 'remove-item cert:\localmachine\my\{{ item }} -force -ea silentlycontinue'
34 with_items:
35 - "{{ thumbprint1.stdout_lines[0] }}"
36 - "{{ thumbprint2.stdout_lines[0] }}"
37 - "{{ thumbprint_wc.stdout_lines[0] }}"
38
39 - name: remove IIS features after test
40 ansible.windows.win_feature:
41 name: Web-Server
42 state: absent
43 include_management_tools: True
44 register: feature_uninstall
45
46 - name: reboot after feature install
47 ansible.windows.win_reboot:
48 when: feature_uninstall.reboot_required