Debian Codegraph @

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

raw symbols SCIP
1 ---
2 - name: test site exists, but stopped in case of duplicate web binding
3 vars:
4 test_sites:
5 - "{{ test_site_name_A }}"
6 - "{{ test_site_name_B }}"
7 website:
8 name: "{{ item }}"
9 state: stopped
10 physical_path: 'C:\inetpub\wwwroot'
11 loop: "{{ test_sites }}"
12
13 - name: Ensure test app is absent (baseline)
14 vars:
15 app_site_pairs:
16 - { site: "{{ test_site_name_A }}", app: "{{ test_app_name_A }}" }
17 - { site: "{{ test_site_name_B }}", app: "{{ test_app_name_B }}" }
18 web_application:
19 state: absent
20 site: "{{ item.site }}"
21 name: "{{ item.app }}"
22 loop: "{{ app_site_pairs }}"
23
24 - name: create test app A
25 web_application:
26 state: present
27 site: "{{ test_site_name_A }}"
28 name: "{{ test_app_name_A }}"
29 physical_path: "{{ test_physical_path_A }}"
30 application_pool: "{{ test_apppool }}"
31 register: result
32
33 - name: create test app B
34 web_application:
35 state: present
36 site: "{{ test_site_name_B }}"
37 name: "{{ test_app_name_B }}"
38 physical_path: "{{ test_physical_path_B }}"
39 register: result
40
41 - name: Fetch info for test_app A
42 web_application_info:
43 name: "{{ test_app_name_A }}"
44 register: test_info
45
46 - name: Check that the fetched info for test_app A is correct
47 assert:
48 that:
49 - test_info.exists
50 - test_info.applications[0].name == test_app_name_A
51 - test_info.applications[0].physical_path == test_physical_path_A
52 - test_info.applications[0].site == test_site_name_A
53 - test_info.applications[0].application_pool == test_apppool
54 - test_info.applications[0].enabled_protocols == 'http'
55 - test_info.applications[0].connect_as == 'pass_through'
56
57 - name: Fetch info for all applications
58 web_application_info:
59 register: test_info_all
60
61 - name: Verify that all applications were fetched
62 assert:
63 that:
64 - test_info_all.exists
65 - test_info_all.applications | length == 2
66
67 - name: Fetch info for by site B
68 web_application_info:
69 site: "{{ test_site_name_B }}"
70 register: test_info_b_by_site
71
72 - name: Check that the fetched info for test_app B is correct
73 assert:
74 that:
75 - test_info_b_by_site.exists
76 - test_info_b_by_site.applications[0].name == test_app_name_B
77 - test_info_b_by_site.applications[0].physical_path == test_physical_path_B
78 - test_info_b_by_site.applications[0].site == test_site_name_B
79 - test_info_b_by_site.applications[0].application_pool == "DefaultAppPool"
80 - test_info_b_by_site.applications[0].enabled_protocols == 'http'
81 - test_info_b_by_site.applications[0].connect_as == 'pass_through'
82
83 - name: Fetch by site and name
84 web_application_info:
85 site: "{{ test_site_name_A }}"
86 name: "{{ test_app_name_A }}"
87 register: test_info_a_by_site_and_name