Skip to content

Add logs and data paths in configuration #105

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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
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
2 changes: 2 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ elasticsearch_service_enabled: true

elasticsearch_network_host: localhost
elasticsearch_http_port: 9200
elasticsearch_log: /var/log/elasticsearch
elasticsearch_data: /var/lib/elasticsearch

elasticsearch_heap_size_min: 1g
elasticsearch_heap_size_max: 2g
Expand Down
12 changes: 12 additions & 0 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,18 @@
notify: restart elasticsearch
when: elasticsearch_version[0] | int >= 7

- name: Create Others Directories
become: yes
file:
path: "{{ item }}"
state: directory
owner: "elasticsearch"
group: "elasticsearch"
mode: "2750"
with_items:
- "{{ elasticsearch_log }}"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

path.data accept multiple locations by comma

- "{{ elasticsearch_data }}"

- name: Force a restart if configuration has changed.
meta: flush_handlers

Expand Down
4 changes: 2 additions & 2 deletions templates/elasticsearch.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@
#
# Path to directory where to store the data (separate multiple locations by comma):
#
path.data: /var/lib/elasticsearch
path.data: {{ elasticsearch_data }}
#
# Path to log files:
#
path.logs: /var/log/elasticsearch
path.logs: {{ elasticsearch_log }}
#
# ----------------------------------- Memory -----------------------------------
#
Expand Down