2019-06-27 13:53:23 -07:00
|
|
|
---
|
|
|
|
|
- name: ensure certificate directory exists
|
|
|
|
|
file:
|
|
|
|
|
dest: "{{ es_ssl_certificate_path }}"
|
|
|
|
|
state: directory
|
|
|
|
|
|
2019-10-11 16:09:05 +01:00
|
|
|
- name: Upload SSL/TLS keystore and truststore
|
2019-06-27 13:53:23 -07:00
|
|
|
copy:
|
|
|
|
|
src: "{{ item }}"
|
|
|
|
|
dest: "{{ es_ssl_certificate_path }}/{{ item | basename }}"
|
|
|
|
|
with_items:
|
2019-10-11 16:33:09 +01:00
|
|
|
- "{{ es_ssl_keystore }}"
|
|
|
|
|
- "{{ es_ssl_truststore }}"
|
2019-10-11 16:09:05 +01:00
|
|
|
when: es_ssl_keystore and es_ssl_truststore
|
2019-10-11 16:33:09 +01:00
|
|
|
#Restart if these change
|
|
|
|
|
notify: restart elasticsearch
|
2019-10-11 16:09:05 +01:00
|
|
|
register: copy_keystores
|
2019-06-27 13:53:23 -07:00
|
|
|
|
2019-10-11 16:09:05 +01:00
|
|
|
- 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
|
2019-10-11 16:33:09 +01:00
|
|
|
#Restart if these change
|
|
|
|
|
notify: restart elasticsearch
|
2019-10-11 16:09:05 +01:00
|
|
|
register: copy_certificates
|
2019-06-27 13:53:23 -07:00
|
|
|
|
|
|
|
|
- name: Upload SSL Certificate Authority
|
|
|
|
|
copy:
|
|
|
|
|
src: "{{ es_ssl_certificate_authority }}"
|
|
|
|
|
dest: "{{ es_ssl_certificate_path }}/{{ es_ssl_certificate_authority | basename }}"
|
2019-10-11 16:09:05 +01:00
|
|
|
when: es_ssl_certificate_authority
|