Add SSL keystore and truststore

This commit is contained in:
Nathan Young 2019-10-11 16:09:05 +01:00
parent 6811cde9db
commit 45ef5a467c
No known key found for this signature in database
GPG key ID: EB5E14327B10D023
5 changed files with 41 additions and 8 deletions

View file

@ -4,20 +4,28 @@
dest: "{{ es_ssl_certificate_path }}"
state: directory
- name: Upload HTTP SSL/TLS certificates
- name: Upload SSL/TLS keystore and truststore
copy:
src: "{{ item }}"
dest: "{{ es_ssl_certificate_path }}/{{ item | basename }}"
with_items:
- "{{ es_ssl_key }}"
- "{{ es_ssl_certificate }}"
when: es_enable_http_ssl|bool or es_enable_transport_ssl|bool
when: es_ssl_keystore and es_ssl_truststore
register: copy_keystores
- local_action: stat path="{{ role_path }}/files/{{ es_ssl_certificate_authority }}"
register: es_cafile
- name: Upload SSL/TLS key and certificate
copy:
src: "{{ item }}"
dest: "{{ es_ssl_certificate_path }}/{{ item | basename }}"
with_items:
- "{{ es_ssl_key }}"
- "{{ es_ssl_certificate }}"
when: es_ssl_key and es_ssl_certificate
register: copy_certificates
- name: Upload SSL Certificate Authority
copy:
src: "{{ es_ssl_certificate_authority }}"
dest: "{{ es_ssl_certificate_path }}/{{ es_ssl_certificate_authority | basename }}"
when: es_cafile.stat.exists|bool and es_cafile.stat.isreg|bool
when: es_ssl_certificate_authority