Skip to content

Commit

Permalink
Support for elastic 8
Browse files Browse the repository at this point in the history
  • Loading branch information
ShaunBoughey committed Aug 14, 2022
1 parent 78c4586 commit a4f8381
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
4 changes: 2 additions & 2 deletions defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
# defaults file for elasticsearch
es_major_version: 7
es_minor_version: 17.5-1
es_major_version: 8
es_minor_version: 3.3-1
es_upgrade: false

es_cluster_name: dev-cluster
Expand Down
16 changes: 15 additions & 1 deletion tasks/security.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,21 @@
no_log: true
notify: restart elasticsearch

- name: Delete Elastic 8.x default TLS secrets
ansible.builtin.command:
argv:
- /usr/share/elasticsearch/bin/elasticsearch-keystore
- remove
- "{{ item }}"
with_items:
- 'xpack.security.http.ssl.keystore.secure_password'
- 'xpack.security.transport.ssl.keystore.secure_password'
- 'xpack.security.transport.ssl.truststore.secure_password'
when:
- list_keystore is defined and 'bootstrap.password' not in list_keystore.stdout_lines and es_bootstrap_password is defined
- es_major_version == 8
notify: restart elasticsearch

- name: Create certificate folder
ansible.builtin.file:
path: /etc/elasticsearch/certs
Expand Down Expand Up @@ -97,4 +112,3 @@

when:
- es_generate_certs == true
- es_major_version == 7
2 changes: 1 addition & 1 deletion templates/elasticsearch.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ xpack.security.enabled: true
xpack.security.http.ssl.enabled: {{ es_tls_enabled }}
xpack.security.transport.ssl.enabled: {{ es_tls_enabled }}
#
{% if es_tls_enabled == true and es_major_version == 7 %}
{% if es_tls_enabled == true %}
{%- if es_generate_certs == true %}
xpack.security.transport.ssl.verification_mode: certificate
xpack.security.transport.ssl.client_authentication: required
Expand Down

0 comments on commit a4f8381

Please sign in to comment.