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

Commit 8156ab4

Browse files
committed
Add option to forgo autogenerated SSL config
1 parent 9496192 commit 8156ab4

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

defaults/main.yml

+1
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ es_debian_startup_timeout: 10
4949
es_jvm_custom_parameters: ''
5050

5151
# SSL/TLS parameters
52+
es_enable_auto_ssl_configuration: true
5253
es_enable_http_ssl: false
5354
es_enable_transport_ssl: false
5455
es_ssl_keystore: ""

docs/ssl-tls-setup.md

+3
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+
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`).
6+
57
The following should be configured to ensure a security-enabled cluster successfully forms:
68

79
* `es_enable_http_ssl` Default `false`. Setting this to `true` will enable HTTP client SSL/TLS
@@ -38,6 +40,7 @@ $ bin/elasticsearch-certutil cert --ca ./my-ca.p12 --out ./my-keystore.p12 --pas
3840

3941
## Additional optional SSL/TLS configuration
4042

43+
* `es_enable_auto_ssl_configuration` Default `true`. Whether this role should add automatically generated SSL config to elasticsearch.yml.
4144
* `es_ssl_certificate_path` Default `{{ es_conf_dir }}/certs`. The location where certificates should be stored on the ES node.
4245
* `es_ssl_verification_mode` Default `certificate`. See [SSL verification_mode](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-settings.html#ssl-tls-settings) for options.
4346
* `es_ssl_certificate_authority` PEM encoded certificate file that should be trusted.

templates/elasticsearch.yml.j2

+2-6
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ action.auto_create_index: {{ es_action_auto_create_index }}
3434
{% if es_enable_xpack and es_api_basic_auth_username is defined and es_api_basic_auth_password is defined %}
3535
xpack.security.enabled: true
3636

37-
{% if es_enable_transport_ssl | bool %}
37+
{% if es_enable_transport_ssl and es_enable_auto_ssl_configuration %}
3838
xpack.security.transport.ssl.enabled: true
3939
xpack.security.transport.ssl.verification_mode: "{{ es_ssl_verification_mode }}"
4040
{% if es_ssl_keystore and es_ssl_truststore %}
@@ -47,11 +47,9 @@ xpack.security.transport.ssl.certificate: "{{ es_ssl_certificate_path }}/{{ es_s
4747
xpack.security.transport.ssl.certificate_authorities: "{{ es_ssl_certificate_path }}/{{ es_ssl_certificate_authority | basename }}"
4848
{% endif %}
4949
{% endif %}
50-
{% else %}
51-
# xpack.security.transport.ssl.enabled: false
5250
{% endif %}
5351

54-
{% if es_enable_http_ssl | bool %}
52+
{% if es_enable_http_ssl and es_enable_auto_ssl_configuration %}
5553
xpack.security.http.ssl.enabled: true
5654
{% if es_ssl_keystore and es_ssl_truststore %}
5755
xpack.security.http.ssl.keystore.path: "{{ es_ssl_certificate_path }}/{{ es_ssl_keystore | basename }}"
@@ -63,8 +61,6 @@ xpack.security.http.ssl.certificate: "{{ es_ssl_certificate_path }}/{{ es_ssl_ce
6361
xpack.security.http.ssl.certificate_authorities: "{{ es_ssl_certificate_path }}/{{ es_ssl_certificate_authority | basename }}"
6462
{% endif %}
6563
{% endif %}
66-
{% else %}
67-
# xpack.security.http.ssl.enabled: false
6864
{% endif %}
6965
{% endif %}
7066

0 commit comments

Comments
 (0)