Debian Codegraph @

ansible_collections/microsoft/iis/tests/integration/targets/web_application/tasks/tests.yml

raw symbols SCIP
1 ---
2 - name: test site exists, but stopped in case of duplicate web binding
3 website:
4 name: "{{ test_site_name }}"
5 state: stopped
6 physical_path: 'C:\inetpub\wwwroot'
7
8 - name: test app is absent (baseline)
9 web_application:
10 state: absent
11 site: "{{ test_site_name }}"
12 name: "{{ test_app_name }}"
13
14 - name: create test app - check mode
15 web_application:
16 state: present
17 site: "{{ test_site_name }}"
18 name: "{{ test_app_name }}"
19 physical_path: "{{ test_physical_path }}"
20 check_mode: true
21 register: result
22
23 - name: Fetch info for test app - check mode
24 web_application_info:
25 name: "{{ test_app_name }}"
26 register: test_info_check
27
28 - assert:
29 that:
30 - result.changed == true
31 - not test_info_check.exists
32
33 - name: create test app
34 web_application:
35 state: present
36 site: "{{ test_site_name }}"
37 name: "{{ test_app_name }}"
38 physical_path: "{{ test_physical_path }}"
39 register: result
40
41 - name: Fetch info for test app
42 web_application_info:
43 name: "{{ test_app_name }}"
44 register: test_info
45
46 - assert:
47 that:
48 - result.changed == true
49 - test_info.applications[0].physical_path == test_physical_path
50
51 - name: create test app (idempotent)
52 web_application:
53 state: present
54 site: "{{ test_site_name }}"
55 name: "{{ test_app_name }}"
56 physical_path: "{{ test_physical_path }}"
57 register: result
58
59 - assert:
60 that:
61 - result.changed == false
62
63 - name: set test app credentials - check mode
64 web_application:
65 state: present
66 site: "{{ test_site_name }}"
67 name: "{{ test_app_name }}"
68 connect_as: specific_user
69 username: "{{ test_user }}"
70 password: "{{ test_password }}"
71 register: result
72 check_mode: true
73
74 - name: Fetch info for test app creds - check mode
75 web_application_info:
76 name: "{{ test_app_name }}"
77 register: test_info_check
78
79 - assert:
80 that:
81 - result.changed == true
82 - test_info_check.applications[0].connect_as == 'pass_through'
83
84 - name: set test app credentials
85 web_application:
86 state: present
87 site: "{{ test_site_name }}"
88 name: "{{ test_app_name }}"
89 connect_as: specific_user
90 username: "{{ test_user }}"
91 password: "{{ test_password }}"
92 register: result
93
94 - name: Fetch info for test app creds
95 web_application_info:
96 name: "{{ test_app_name }}"
97 register: test_info
98
99 - assert:
100 that:
101 - result.changed == true
102 - test_info.applications[0].physical_path == test_physical_path
103 - test_info.applications[0].connect_as == 'specific_user'
104 - test_info.applications[0].username == test_user
105
106 - name: set test app credentials (idempotent)
107 web_application:
108 state: present
109 site: "{{ test_site_name }}"
110 name: "{{ test_app_name }}"
111 connect_as: specific_user
112 username: "{{ test_user }}"
113 password: "{{ test_password }}"
114 register: result
115
116 - assert:
117 that:
118 - result.changed == false
119
120 - name: create new test application pool
121 web_app_pool:
122 name: "{{ test_apppool }}"
123 state: present
124
125 - name: change app pool and use pass through authentication
126 web_application:
127 state: present
128 site: "{{ test_site_name }}"
129 name: "{{ test_app_name }}"
130 connect_as: pass_through
131 application_pool: "{{ test_apppool }}"
132 register: result
133
134 - name: Fetch info test_app with app pool
135 web_application_info:
136 name: "{{ test_app_name }}"
137 register: test_info
138
139 - assert:
140 that:
141 - result.changed == true
142 - test_info.applications[0].physical_path == test_physical_path
143 - test_info.applications[0].application_pool == test_apppool
144 - test_info.applications[0].connect_as == 'pass_through'
145
146 - name: Verify input failure due to missing username and password when connecting as specific user
147 web_application:
148 state: present
149 site: "{{ test_site_name }}"
150 name: "{{ test_app_name }}"
151 connect_as: specific_user
152 application_pool: "{{ test_apppool }}"
153 register: failure
154 failed_when: "'missing required arguments: username' not in failure.msg"
155
156 - name: Remove test app - check mode
157 web_application:
158 state: absent
159 site: "{{ test_site_name }}"
160 name: "{{ test_app_name }}"
161 check_mode: true
162
163 - name: Fetch info for test app after removal - check mode
164 web_application_info:
165 name: "{{ test_app_name }}"
166 register: test_info_check_removal
167
168 - assert:
169 that:
170 - result.changed == true
171 - test_info_check_removal.exists
172
173 - name: Remove test app
174 web_application:
175 state: absent
176 site: "{{ test_site_name }}"
177 name: "{{ test_app_name }}"
178
179 - name: Fetch info for test app after removal
180 web_application_info:
181 name: "{{ test_app_name }}"
182 register: test_info_check_removal
183
184 - assert:
185 that:
186 - result.changed == true
187 - not test_info_check_removal.exists
188
189 - name: Remove test app (idempotent)
190 web_application:
191 state: absent
192 site: "{{ test_site_name }}"
193 name: "{{ test_app_name }}"
194 register: result
195
196 - assert:
197 that:
198 - result.changed == false