mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-06-28 03:00:23 -07:00
Test that uri module validates certs
This commit is contained in:
parent
0f4a3409d8
commit
1bda7cc200
1 changed files with 35 additions and 0 deletions
|
@ -91,3 +91,38 @@
|
||||||
with_together:
|
with_together:
|
||||||
- fail_checksum.results
|
- fail_checksum.results
|
||||||
- fail.results
|
- fail.results
|
||||||
|
|
||||||
|
- name: test https fetch to a site with mismatched hostname and certificate
|
||||||
|
uri:
|
||||||
|
url: "https://kennethreitz.org/"
|
||||||
|
dest: "{{ output_dir }}/shouldnotexist.html"
|
||||||
|
ignore_errors: True
|
||||||
|
register: result
|
||||||
|
|
||||||
|
- stat:
|
||||||
|
path: "{{ output_dir }}/shouldnotexist.html"
|
||||||
|
register: stat_result
|
||||||
|
|
||||||
|
- name: Assert that the file was not downloaded
|
||||||
|
assert:
|
||||||
|
that:
|
||||||
|
- "result.failed == true"
|
||||||
|
- "'certificate does not match ' in result.msg"
|
||||||
|
- "stat_result.stat.exists == false"
|
||||||
|
|
||||||
|
- name: test https fetch to a site with mismatched hostname and certificate and validate_certs=no
|
||||||
|
get_url:
|
||||||
|
url: "https://kennethreitz.org/"
|
||||||
|
dest: "{{ output_dir }}/kreitz.html"
|
||||||
|
validate_certs: no
|
||||||
|
register: result
|
||||||
|
|
||||||
|
- stat:
|
||||||
|
path: "{{ output_dir }}/kreitz.html"
|
||||||
|
register: stat_result
|
||||||
|
|
||||||
|
- name: Assert that the file was not downloaded
|
||||||
|
assert:
|
||||||
|
that:
|
||||||
|
- "result.failed == false"
|
||||||
|
- "stat_result.stat.exists == true"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue