summaryrefslogtreecommitdiffstats
path: root/test/integration/targets/prepare_http_tests/tasks/default.yml
diff options
context:
space:
mode:
Diffstat (limited to 'test/integration/targets/prepare_http_tests/tasks/default.yml')
-rw-r--r--test/integration/targets/prepare_http_tests/tasks/default.yml55
1 files changed, 55 insertions, 0 deletions
diff --git a/test/integration/targets/prepare_http_tests/tasks/default.yml b/test/integration/targets/prepare_http_tests/tasks/default.yml
new file mode 100644
index 0000000..2fb26a1
--- /dev/null
+++ b/test/integration/targets/prepare_http_tests/tasks/default.yml
@@ -0,0 +1,55 @@
+- 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: Get client cert/key
+ get_url:
+ url: "http://ansible.http.tests/{{ item }}"
+ dest: "{{ remote_tmp_dir }}/{{ item }}"
+ with_items:
+ - client.pem
+ - client.key
+
+- name: Suse - Retrieve test cacert
+ get_url:
+ url: "http://ansible.http.tests/cacert.pem"
+ dest: "/etc/pki/trust/anchors/ansible.pem"
+ when: ansible_os_family == 'Suse'
+
+- name: Debian/Alpine - Retrieve test cacert
+ get_url:
+ url: "http://ansible.http.tests/cacert.pem"
+ dest: "/usr/local/share/ca-certificates/ansible.crt"
+ when: ansible_os_family in ['Debian', 'Alpine']
+
+- name: Redhat - Update ca trust
+ command: update-ca-trust extract
+ when: ansible_os_family == 'RedHat'
+
+- name: Debian/Alpine/Suse - Update ca certificates
+ command: update-ca-certificates
+ when: ansible_os_family in ['Debian', 'Alpine', 'Suse']
+
+- name: Update cacert
+ when: ansible_os_family in ['FreeBSD', 'Darwin']
+ block:
+ - name: Retrieve test cacert
+ uri:
+ url: "http://ansible.http.tests/cacert.pem"
+ return_content: true
+ register: cacert_pem
+
+ - name: Locate cacert
+ command: '{{ ansible_python_interpreter }} -c "import ssl; print(ssl.get_default_verify_paths().cafile)"'
+ register: cafile_path
+
+ - name: Update cacert
+ blockinfile:
+ path: "{{ cafile_path.stdout_lines|first }}"
+ block: "{{ cacert_pem.content }}"