mirror of https://github.com/ansible/ansible.git
Use httptester docker image for http tests (#15811)
* Use httptester docker image for http tests
* When not running with an httptester linked container, use public test sites
(cherry picked from commit accf40d8a8
)
pull/16362/head
parent
73b250ecf7
commit
df33ff6c65
@ -0,0 +1,3 @@
|
|||||||
|
badssl_host: wrong.host.badssl.com
|
||||||
|
httpbin_host: httpbin.org
|
||||||
|
sni_host: sni.velox.ch
|
@ -0,0 +1,35 @@
|
|||||||
|
# The docker --link functionality gives us an ENV var we can key off of to see if we have access to
|
||||||
|
# the httptester container
|
||||||
|
- set_fact:
|
||||||
|
has_httptester: "{{ lookup('env', 'ANSIBLE.HTTP.TESTS_PORT_80_TCP_ADDR') != '' }}"
|
||||||
|
|
||||||
|
# If we are running with access to a httptester container, grab it's cacert and install it
|
||||||
|
- block:
|
||||||
|
# Override hostname defaults with httptester linked names
|
||||||
|
- include_vars: httptester.yml
|
||||||
|
|
||||||
|
- name: RedHat - Enable the dynamic CA configuration feature
|
||||||
|
command: update-ca-trust force-enable
|
||||||
|
when: ansible_os_family == 'RedHat'
|
||||||
|
|
||||||
|
- name: RedHat - Retrieve test cacert
|
||||||
|
get_url:
|
||||||
|
url: "http://ansible.http.tests/cacert.pem"
|
||||||
|
dest: "/etc/pki/ca-trust/source/anchors/ansible.pem"
|
||||||
|
when: ansible_os_family == 'RedHat'
|
||||||
|
|
||||||
|
- name: Debian - Retrieve test cacert
|
||||||
|
get_url:
|
||||||
|
url: "http://ansible.http.tests/cacert.pem"
|
||||||
|
dest: "/usr/local/share/ca-certificates/ansible.crt"
|
||||||
|
when: ansible_os_family == 'Debian'
|
||||||
|
|
||||||
|
- name: Redhat - Update ca trust
|
||||||
|
command: update-ca-trust extract
|
||||||
|
when: ansible_os_family == 'RedHat'
|
||||||
|
|
||||||
|
- name: Debian - Update ca certificates
|
||||||
|
command: update-ca-certificates
|
||||||
|
when: ansible_os_family == 'Debian'
|
||||||
|
|
||||||
|
when: has_httptester|bool
|
@ -0,0 +1,4 @@
|
|||||||
|
# these are fake hostnames provided by docker link for the httptester container
|
||||||
|
badssl_host: fail.ansible.http.tests
|
||||||
|
httpbin_host: ansible.http.tests
|
||||||
|
sni_host: sni1.ansible.http.tests
|
@ -1,3 +1,4 @@
|
|||||||
dependencies:
|
dependencies:
|
||||||
- prepare_tests
|
- prepare_tests
|
||||||
|
- prepare_http_tests
|
||||||
|
|
||||||
|
@ -1,2 +1,3 @@
|
|||||||
dependencies:
|
dependencies:
|
||||||
- prepare_tests
|
- prepare_tests
|
||||||
|
- prepare_http_tests
|
||||||
|
Loading…
Reference in New Issue