mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
beb0fd9b8b
* win_iis_webbinding: Fix bug with ipaddress * returning multiple bindings instead of only the ones defined as *. Address possible future issues around hostheader * by just disallowing it. Resolves 25473. Added new test for this case. Removed all validation for https binding collisions due to difficulty in validating all cases in which they could or could not collide. As a result, also removed return values relating to certificate data. Updated testing and docs appropriately * win_iis_webbinding: added break to remove binding loops
70 lines
1.7 KiB
YAML
70 lines
1.7 KiB
YAML
- name: failure check define * for host header
|
|
win_iis_webbinding:
|
|
name: "{{ test_iis_site_name }}"
|
|
state: present
|
|
host_header: '*'
|
|
protocol: http
|
|
ip: '*'
|
|
register: failure
|
|
failed_when: failure.msg != "To make or remove a catch-all binding, please omit the host_header parameter entirely rather than specify host_header *"
|
|
|
|
- debug:
|
|
var: failure
|
|
verbosity: 1
|
|
|
|
- block:
|
|
- name: get all websites from server
|
|
raw: powershell.exe "(get-website).name"
|
|
register: existing_sites
|
|
|
|
- name: ensure all sites are removed for clean testing
|
|
win_iis_website:
|
|
name: "{{ item }}"
|
|
state: absent
|
|
with_items:
|
|
- "{{ existing_sites.stdout_lines }}"
|
|
|
|
- name: add testremove site
|
|
win_iis_website:
|
|
name: testremove
|
|
state: started
|
|
physical_path: c:\inetpub\wwwroot
|
|
|
|
- name: add bindings to testremove
|
|
win_iis_webbinding:
|
|
name: testremove
|
|
ip: "{{ item.ip }}"
|
|
port: "{{ item.port }}"
|
|
with_items:
|
|
- {ip: 127.0.0.1, port: 80}
|
|
- {ip: '*', port: 80}
|
|
|
|
- name: remove ip * binding from testremove
|
|
win_iis_webbinding:
|
|
name: testremove
|
|
state: absent
|
|
port: 80
|
|
ip: '*'
|
|
|
|
- name: get the remaining binding from testremove
|
|
test_get_webbindings:
|
|
name: testremove
|
|
port: 80
|
|
ip: 127.0.0.1
|
|
register: test_result
|
|
|
|
- debug:
|
|
var: test_result
|
|
verbosity: 1
|
|
|
|
- name: assert that remove *:80 doesn't also remove 127.0.0.1:80
|
|
assert:
|
|
that:
|
|
- test_result.binding.ip == '127.0.0.1'
|
|
- test_result.binding.port == 80
|
|
|
|
always:
|
|
- name: remove websites
|
|
win_iis_website:
|
|
name: testremove
|
|
state: absent
|