|
|
@ -45,11 +45,20 @@
|
|
|
|
return_content: true
|
|
|
|
return_content: true
|
|
|
|
register: cacert_pem
|
|
|
|
register: cacert_pem
|
|
|
|
|
|
|
|
|
|
|
|
- name: Locate cacert
|
|
|
|
- name: Locate capath
|
|
|
|
command: '{{ ansible_python_interpreter }} -c "import ssl; print(ssl.get_default_verify_paths().cafile)"'
|
|
|
|
command: '{{ ansible_python_interpreter }} -c "import ssl; print(ssl.get_default_verify_paths().capath)"'
|
|
|
|
register: cafile_path
|
|
|
|
register: capath
|
|
|
|
|
|
|
|
|
|
|
|
- name: Update cacert
|
|
|
|
- name: Assert capath is set
|
|
|
|
blockinfile:
|
|
|
|
assert:
|
|
|
|
path: "{{ cafile_path.stdout_lines|first }}"
|
|
|
|
that: capath.stdout
|
|
|
|
block: "{{ cacert_pem.content }}"
|
|
|
|
|
|
|
|
|
|
|
|
- name: Add cacert to capath
|
|
|
|
|
|
|
|
copy:
|
|
|
|
|
|
|
|
content: "{{ cacert_pem.content }}"
|
|
|
|
|
|
|
|
dest: "{{ capath.stdout }}/ansible-http-test.pem"
|
|
|
|
|
|
|
|
notify: Remove cacert from capath
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- name: Register cacert
|
|
|
|
|
|
|
|
command: openssl rehash {{ capath.stdout }}
|
|
|
|
|
|
|
|
notify: Unregister cacert
|
|
|
|