roles/trustca: Generic role for adding CA certs

The `trustca` role can be used to add CA certificates to the system
trust store. It requires a variable, `ca`, to be defined, referring to
the name of a file containing a CA certificate to install.
jenkins-master
Dustin 2018-06-04 19:34:24 -05:00
parent 4f6260d77d
commit 861c6f4fe1
5 changed files with 24 additions and 0 deletions

View File

@ -0,0 +1,2 @@
- name: update ca certs
command: '{{ ca_update_cmd }}'

View File

@ -0,0 +1,16 @@
- name: load distribution-specific variables
include_vars: '{{ item }}'
with_first_found:
- '{{ ansible_distribution }}.yml'
- '{{ ansible_os_family }}.yml'
- defaults.yml
- name: ensure ca cert dir exists
file:
path={{ ca_store_dir }}
state=directory
- name: ensure ca cert is installed
copy:
src={{ ca }}.crt
dest={{ ca_store_dir }}
notify: update ca certs
- meta: flush_handlers

View File

@ -0,0 +1,2 @@
ca_store_dir: /etc/pki/ca-trust/source/anchors
ca_update_cmd: update-ca-trust

View File

@ -0,0 +1,2 @@
ca_store_dir: /etc/pki/ca-trust/source/anchors
ca_update_cmd: update-ca-trust

View File

@ -0,0 +1,2 @@
ca_store_dir: /usr/local/share/ca-certificates
ca_update_cmd: update-ca-certificates