Commit 96807072 by Toshio Kuratomi

Add test that url lookup checks tls certificates

parent 2829d0f6
......@@ -129,3 +129,33 @@
debug: msg={{item}}
with_items: things2
# URL Lookups
- name: Test that retrieving a url works
set_fact:
web_data: "{{ lookup('url', 'https://gist.githubusercontent.com/abadger/9858c22712f62a8effff/raw/43dd47ea691c90a5fa7827892c70241913351963/test') }}"
- name: Assert that the url was retrieved
assert:
that:
- "'one' in web_data"
- name: Test that retrieving a url with invalid cert fails
set_fact:
web_data: "{{ lookup('url', 'https://kennethreitz.org/') }}"
ignore_errors: True
register: url_invalid_cert
- assert:
that:
- "url_invalid_cert.failed"
- "'Error validating the server' in url_invalid_cert.msg"
- name: Test that retrieving a url with invalid cert with validate_certs=False works
set_fact:
web_data: "{{ lookup('url', 'https://kennethreitz.org/', validate_certs=False) }}"
register: url_no_validate_cert
- assert:
that:
- "'kennethreitz.org' in web_data"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment