Debian Codegraph @

test/integration/targets/prepare_http_tests/tasks/default.yml

raw
1 - name: RedHat - Enable the dynamic CA configuration feature
2 command: update-ca-trust
3 when: ansible_os_family == 'RedHat' and ansible_distribution != "Fedora"
4
5 - name: RedHat - Retrieve test cacert
6 get_url:
7 url: "http://ansible.http.tests/cacert.pem"
8 dest: "/etc/pki/ca-trust/source/anchors/ansible.pem"
9 when: ansible_os_family == 'RedHat'
10
11 - name: Get client cert/key
12 get_url:
13 url: "http://ansible.http.tests/{{ item }}"
14 dest: "{{ remote_tmp_dir }}/{{ item }}"
15 with_items:
16 - client.pem
17 - client.key
18
19 - name: Debian/Alpine - Retrieve test cacert
20 get_url:
21 url: "http://ansible.http.tests/cacert.pem"
22 dest: "/usr/local/share/ca-certificates/ansible.crt"
23 when: ansible_os_family in ['Debian', 'Alpine']
24
25 - name: Redhat - Update ca trust
26 command: update-ca-trust extract
27 when: ansible_os_family == 'RedHat'
28
29 - name: Debian/Alpine - Update ca certificates
30 command: update-ca-certificates
31 when: ansible_os_family in ['Debian', 'Alpine']
32
33 - name: Update cacert
34 when: ansible_os_family in ['FreeBSD', 'Darwin']
35 block:
36 - name: Retrieve test cacert
37 uri:
38 url: "http://ansible.http.tests/cacert.pem"
39 return_content: true
40 register: cacert_pem
41
42 - name: Locate cacert
43 command: '{{ ansible_python_interpreter }} -c "import ssl; print(ssl.get_default_verify_paths().cafile)"'
44 register: cafile_path
45
46 - name: Update cacert
47 blockinfile:
48 path: "{{ cafile_path.stdout_lines|first }}"
49 block: "{{ cacert_pem.content }}"