Debian Codegraph @

ansible_collections/community/windows/tests/integration/targets/setup_http_tests/tasks/main.yml

raw
1 # The docker --link functionality gives us an ENV var we can key off of to see if we have access to
2 # the httptester container
3 - set_fact:
4 has_httptester: "{{ lookup('env', 'HTTPTESTER') != '' }}"
5
6 - name: If we are running with access to a httptester container, grab it's cacert and install it
7 when: has_httptester | bool
8 block:
9 - name: Override hostname defaults with httptester linked names
10 include_vars: httptester.yml
11
12 - name: make sure the port forwarder is active
13 ansible.windows.win_wait_for:
14 host: ansible.http.tests
15 port: 80
16 state: started
17 timeout: 300
18
19 - name: get client cert/key
20 ansible.windows.win_get_url:
21 url: http://ansible.http.tests/{{ item }}
22 dest: '{{ remote_tmp_dir }}\{{ item }}'
23 register: win_download
24 retries: 5 # Just have a retry in case the host is running a bit slower today.
25 until: win_download is successful
26 with_items:
27 - client.pem
28 - client.key
29
30 - name: retrieve test cacert
31 ansible.windows.win_get_url:
32 url: http://ansible.http.tests/cacert.pem
33 dest: '{{ remote_tmp_dir }}\cacert.pem'
34
35 - name: update ca trust
36 ansible.windows.win_certificate_store:
37 path: '{{ remote_tmp_dir }}\cacert.pem'
38 state: present
39 store_location: LocalMachine
40 store_name: Root
41 register: httptester_ca_cert_info
42 notify: remove CA trust store cert