@ -19,8 +19,8 @@
- name : set role facts
set_fact:
http_port : 15260
files_dir : '{{ output _dir|expanduser }}/files'
checkout_dir : '{{ output _dir }}/git'
files_dir : '{{ remote_tmp _dir|expanduser }}/files'
checkout_dir : '{{ remote_tmp _dir }}/git'
- name : create a directory to serve files from
file:
@ -39,10 +39,10 @@
- copy:
src : "testserver.py"
dest : "{{ output _dir }}/testserver.py"
dest : "{{ remote_tmp _dir }}/testserver.py"
- name : start SimpleHTTPServer
shell : cd {{ files_dir }} && {{ ansible_python.executable }} {{ output _dir}}/testserver.py {{ http_port }}
shell : cd {{ files_dir }} && {{ ansible_python.executable }} {{ remote_tmp _dir}}/testserver.py {{ http_port }}
async : 120 # this test set can take ~1m to run on FreeBSD (via Shippable)
poll : 0
@ -91,12 +91,12 @@
- name : test https fetch to a site with mismatched hostname and certificate
uri:
url : "https://{{ badssl_host }}/"
dest : "{{ output _dir }}/shouldnotexist.html"
dest : "{{ remote_tmp _dir }}/shouldnotexist.html"
ignore_errors : True
register : result
- stat:
path : "{{ output _dir }}/shouldnotexist.html"
path : "{{ remote_tmp _dir }}/shouldnotexist.html"
register : stat_result
- name : Assert that the file was not downloaded
@ -111,18 +111,18 @@
- name : Clean up any cruft from the results directory
file:
name : "{{ output _dir }}/kreitz.html"
name : "{{ remote_tmp _dir }}/kreitz.html"
state : absent
- name : test https fetch to a site with mismatched hostname and certificate and validate_certs=no
uri:
url : "https://{{ badssl_host }}/"
dest : "{{ output _dir }}/kreitz.html"
dest : "{{ remote_tmp _dir }}/kreitz.html"
validate_certs : no
register : result
- stat:
path : "{{ output _dir }}/kreitz.html"
path : "{{ remote_tmp _dir }}/kreitz.html"
register : stat_result
- name : Assert that the file was downloaded
@ -139,13 +139,13 @@
- name : test https fetch to a site with self signed certificate using ca_path
uri:
url : "https://{{ self_signed_host }}:444/"
dest : "{{ output _dir }}/self-signed_using_ca_path.html"
dest : "{{ remote_tmp _dir }}/self-signed_using_ca_path.html"
ca_path : "{{ remote_tmp_dir }}/ca2cert.pem"
validate_certs : yes
register : result
- stat:
path : "{{ output _dir }}/self-signed_using_ca_path.html"
path : "{{ remote_tmp _dir }}/self-signed_using_ca_path.html"
register : stat_result
- name : Assert that the file was downloaded
@ -157,13 +157,13 @@
- name : test https fetch to a site with self signed certificate without using ca_path
uri:
url : "https://{{ self_signed_host }}:444/"
dest : "{{ output _dir }}/self-signed-without_using_ca_path.html"
dest : "{{ remote_tmp _dir }}/self-signed-without_using_ca_path.html"
validate_certs : yes
register : result
ignore_errors : true
- stat:
path : "{{ output _dir }}/self-signed-without_using_ca_path.html"
path : "{{ remote_tmp _dir }}/self-signed-without_using_ca_path.html"
register : stat_result
- name : Assure that https access to a host with self-signed certificate without providing ca_path fails
@ -672,16 +672,16 @@
- name : Create a testing file
copy:
content : "content"
dest : "{{ output _dir }}/output"
dest : "{{ remote_tmp _dir }}/output"
- name : Download a file from non existing location
uri:
url : http://does/not/exist
dest : "{{ output _dir }}/output"
dest : "{{ remote_tmp _dir }}/output"
ignore_errors : yes
- name : Save testing file's output
command : "cat {{ output _dir }}/output"
command : "cat {{ remote_tmp _dir }}/output"
register : file_out
- name : Test the testing file was not overwritten
@ -691,7 +691,7 @@
- name : Clean up
file:
dest : "{{ output _dir }}/output"
dest : "{{ remote_tmp _dir }}/output"
state : absent
- name : Test follow_redirects=none