Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add es_ssl_remote_src var for cert upload conditions #8

Merged
merged 1 commit into from
Jul 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ es_heap_dump_path: "/var/lib/elasticsearch"
es_enable_auto_ssl_configuration: true
es_enable_http_ssl: false
es_enable_transport_ssl: false
es_ssl_remote_src: false
es_ssl_upload: true
es_ssl_keystore: ""
es_ssl_keystore_password: ""
Expand Down
1 change: 1 addition & 0 deletions docs/ssl-tls-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ $ bin/elasticsearch-certutil cert --ca ./my-ca.p12 --out ./my-keystore.p12 --pas
- `es_enable_auto_ssl_configuration` Default `true`. Whether this role should add automatically generated SSL config to elasticsearch.yml.
- `es_ssl_certificate_path` Default `{{ es_conf_dir }}/certs`. The location where certificates should be stored on the ES node.
- `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.
- `es_ssl_remote_src` Default `false`. Whether the certificate files should be copied from a local or remote source.
- `es_ssl_certificate_authority` PEM encoded certificate file that should be trusted.
- `es_validate_certs` Default `yes`. Determines if ansible should validate SSL certificates when performing actions over HTTPS. e.g. installing templates and managing native users.

Expand Down
4 changes: 4 additions & 0 deletions tasks/elasticsearch-ssl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
owner: "{{ es_user }}"
group: "{{ es_group }}"
mode: "640"
remote_src: "{{ es_ssl_remote_src }}"
when: es_ssl_upload and es_ssl_keystore and es_ssl_truststore
notify: restart elasticsearch
register: copy_keystore
Expand All @@ -37,6 +38,7 @@
owner: "{{ es_user }}"
group: "{{ es_group }}"
mode: "640"
remote_src: "{{ es_ssl_remote_src }}"
when: es_ssl_upload and es_ssl_keystore and es_ssl_truststore
notify: restart elasticsearch
register: copy_truststore
Expand All @@ -49,6 +51,7 @@
owner: "{{ es_user }}"
group: "{{ es_group }}"
mode: "640"
remote_src: "{{ es_ssl_remote_src }}"
with_items:
- "{{ es_ssl_key }}"
- "{{ es_ssl_certificate }}"
Expand All @@ -65,6 +68,7 @@
owner: "{{ es_user }}"
group: "{{ es_group }}"
mode: "640"
remote_src: "{{ es_ssl_remote_src }}"
#Restart if this changes
notify: restart elasticsearch
when: es_ssl_upload and (es_ssl_certificate_authority is defined) and (es_ssl_certificate_authority|length > 0)
Expand Down