Skip to content
This repository was archived by the owner on Jun 24, 2022. It is now read-only.

Commit fdfaa5c

Browse files
authored
Add an option to not upload SSL/TLS certs (#727)
1 parent 2a3793c commit fdfaa5c

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

defaults/main.yml

+1
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ es_heap_dump_path: "/var/lib/elasticsearch"
5555
es_enable_auto_ssl_configuration: true
5656
es_enable_http_ssl: false
5757
es_enable_transport_ssl: false
58+
es_ssl_upload: true
5859
es_ssl_keystore: ""
5960
es_ssl_keystore_password: ""
6061
es_ssl_truststore: ""

docs/ssl-tls-setup.md

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
The role allows configuring HTTP and transport layer SSL/TLS for the cluster. You will need to generate and provide your own PKCS12 or PEM encoded certificates as described in [Encrypting communications in Elasticsearch](https://www.elastic.co/guide/en/elasticsearch/reference/7.4/configuring-tls.html#configuring-tls).
44

5+
By default this role will upload the certs to your elasticsearch servers. If you already copied the certs by your own way, set `es_ssl_upload` to `false` (default: `true`)
6+
57
If you don't want this role to add autogenerated SSL configuration to elasticsearch.yml set `es_enable_auto_ssl_configuration` to `false` (default: `true`).
68

79
The following should be configured to ensure a security-enabled cluster successfully forms:

tasks/elasticsearch-ssl.yml

+6-5
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,15 @@
77
set_fact: es_same_keystore=true
88
when: es_ssl_keystore == es_ssl_truststore
99

10-
- name: ensure certificate directory exists
10+
- name: Ensure certificate directory exists
1111
become: yes
1212
file:
1313
dest: "{{ es_ssl_certificate_path }}"
1414
state: directory
1515
owner: root
1616
group: "{{ es_group }}"
1717
mode: "750"
18+
when: es_ssl_upload
1819

1920
- name: Upload SSL/TLS keystore
2021
become: yes
@@ -24,7 +25,7 @@
2425
owner: "{{ es_user }}"
2526
group: "{{ es_group }}"
2627
mode: "640"
27-
when: es_ssl_keystore and es_ssl_truststore
28+
when: es_ssl_upload and es_ssl_keystore and es_ssl_truststore
2829
notify: restart elasticsearch
2930
register: copy_keystore
3031

@@ -36,7 +37,7 @@
3637
owner: "{{ es_user }}"
3738
group: "{{ es_group }}"
3839
mode: "640"
39-
when: es_ssl_keystore and es_ssl_truststore
40+
when: es_ssl_upload and es_ssl_keystore and es_ssl_truststore
4041
notify: restart elasticsearch
4142
register: copy_truststore
4243

@@ -51,7 +52,7 @@
5152
with_items:
5253
- "{{ es_ssl_key }}"
5354
- "{{ es_ssl_certificate }}"
54-
when: es_ssl_key and es_ssl_certificate
55+
when: es_ssl_upload and es_ssl_key and es_ssl_certificate
5556
#Restart if these change
5657
notify: restart elasticsearch
5758
register: copy_certificates
@@ -66,7 +67,7 @@
6667
mode: "640"
6768
#Restart if this changes
6869
notify: restart elasticsearch
69-
when: (es_ssl_certificate_authority is defined) and (es_ssl_certificate_authority|length > 0)
70+
when: es_ssl_upload and (es_ssl_certificate_authority is defined) and (es_ssl_certificate_authority|length > 0)
7071

7172
- name: Set keystore password
7273
become: yes

0 commit comments

Comments
 (0)