2016-05-11 03:43:07 +00:00
|
|
|
# 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:
|
2016-05-31 21:47:36 +00:00
|
|
|
has_httptester: "{{ lookup('env', 'HTTPTESTER') != '' }}"
|
2016-05-11 03:43:07 +00:00
|
|
|
|
|
|
|
# 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'
|
|
|
|
|
2016-05-31 21:47:36 +00:00
|
|
|
- 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'
|
|
|
|
|
2016-05-11 03:43:07 +00:00
|
|
|
- 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'
|
|
|
|
|
2016-05-31 21:47:36 +00:00
|
|
|
- name: Debian/Suse - Update ca certificates
|
2016-05-11 03:43:07 +00:00
|
|
|
command: update-ca-certificates
|
2016-05-31 21:47:36 +00:00
|
|
|
when: ansible_os_family == 'Debian' or ansible_os_family == 'Suse'
|
2016-05-11 03:43:07 +00:00
|
|
|
|
|
|
|
when: has_httptester|bool
|