Debian Codegraph @

ansible_collections/community/windows/tests/integration/targets/win_iis_webapplication/tasks/tests.yml

raw
1 ---
2 - name: test site exists, but stopped in case of duplicate web binding
3 win_iis_website:
4 name: "{{ test_site_name }}"
5 state: stopped
6 physical_path: 'C:\inetpub\wwwroot'
7
8 - name: test app is absent (baseline)
9 win_iis_webapplication:
10 state: absent
11 site: "{{ test_site_name }}"
12 name: "{{ test_app_name }}"
13
14 - name: create test app
15 win_iis_webapplication:
16 state: present
17 site: "{{ test_site_name }}"
18 name: "{{ test_app_name }}"
19 physical_path: "{{ test_physical_path }}"
20 register: result
21
22 - assert:
23 that:
24 - 'result.changed == true'
25 - 'result.physical_path == test_physical_path'
26
27 - name: create test app (idempotent)
28 win_iis_webapplication:
29 state: present
30 site: "{{ test_site_name }}"
31 name: "{{ test_app_name }}"
32 physical_path: "{{ test_physical_path }}"
33 register: result
34
35 - assert:
36 that:
37 - 'result.changed == false'
38 - 'result.physical_path == test_physical_path'
39
40 - name: set test app credentials
41 win_iis_webapplication:
42 state: present
43 site: "{{ test_site_name }}"
44 name: "{{ test_app_name }}"
45 connect_as: specific_user
46 username: "{{ test_user }}"
47 password: "{{ test_password }}"
48 register: result
49
50 - assert:
51 that:
52 - 'result.changed == true'
53 - 'result.physical_path == test_physical_path'
54 - "result.connect_as == 'specific_user'"
55
56 - name: set test app credentials (idempotent)
57 win_iis_webapplication:
58 state: present
59 site: "{{ test_site_name }}"
60 name: "{{ test_app_name }}"
61 connect_as: specific_user
62 username: "{{ test_user }}"
63 password: "{{ test_password }}"
64 register: result
65
66 - assert:
67 that:
68 - 'result.changed == false'
69 - 'result.physical_path == test_physical_path'
70 - "result.connect_as == 'specific_user'"
71
72 - name: create new test application pool
73 win_iis_webapppool:
74 name: "{{ test_apppool }}"
75 state: present
76
77 - name: change app pool and use pass through authentication
78 win_iis_webapplication:
79 state: present
80 site: "{{ test_site_name }}"
81 name: "{{ test_app_name }}"
82 connect_as: pass_through
83 application_pool: "{{ test_apppool }}"
84 register: result
85
86 - assert:
87 that:
88 - 'result.changed == true'
89 - 'result.physical_path == test_physical_path'
90 - "result.connect_as == 'pass_through'"
91 - "result.application_pool == test_apppool"