2023-07-28 13:18:08 +00:00
|
|
|
---
|
2024-10-28 19:25:21 +00:00
|
|
|
elasticsearch_version: 8.15.3
|
2024-10-28 19:24:14 +00:00
|
|
|
elasticsearch_state: present
|
2023-07-28 13:18:08 +00:00
|
|
|
|
|
|
|
elasticsearch_base_path: /opt/elasticsearch
|
|
|
|
elasticsearch_data_path: "{{ elasticsearch_base_path }}/data"
|
|
|
|
|
|
|
|
elasticsearch_config_cluster_name: elastic
|
|
|
|
elasticsearch_config_discovery_type: single-node
|
|
|
|
elasticsearch_config_boostrap_memory_lock: true
|
|
|
|
elasticsearch_allocated_ram_mb: 512
|
|
|
|
|
2024-10-28 19:24:14 +00:00
|
|
|
elasticsearch_container_image_registry: docker.elastic.co
|
|
|
|
elasticsearch_container_image_namespace: elasticsearch
|
|
|
|
elasticsearch_container_image_name: elasticsearch-oss
|
2023-07-28 13:18:08 +00:00
|
|
|
elasticsearch_container_image_tag: ~
|
2024-10-28 19:24:14 +00:00
|
|
|
elasticsearch_container_image: >-2
|
|
|
|
{{
|
|
|
|
([
|
|
|
|
elasticsearch_container_image_registry | default([], true),
|
|
|
|
elasticsearch_container_image_namespace | default([], true),
|
|
|
|
elasticsearch_container_image_name,
|
|
|
|
] | flatten | join('/'))
|
|
|
|
+ ':' +
|
|
|
|
(elasticsearch_container_image_tag | default(elasticsearch_version, true))
|
|
|
|
}}
|
|
|
|
elasticsearch_container_image_source: pull
|
|
|
|
elasticsearch_container_image_force_source: >-2
|
|
|
|
{{ elasticsearch_container_image_tag | default(false, true) | bool }}
|
2023-07-28 13:18:08 +00:00
|
|
|
|
|
|
|
elasticsearch_container_name: elasticsearch
|
|
|
|
elasticsearch_container_env:
|
|
|
|
"ES_JAVA_OPTS": "-Xms{{ elasticsearch_allocated_ram_mb }}m -Xmx{{ elasticsearch_allocated_ram_mb }}m"
|
|
|
|
"cluster.name": "{{ elasticsearch_config_cluster_name }}"
|
|
|
|
"discovery.type": "{{ elasticsearch_config_discovery_type }}"
|
|
|
|
"bootstrap.memory_lock": "{{ 'true' if elasticsearch_config_boostrap_memory_lock else 'false' }}"
|
|
|
|
elasticsearch_container_user: ~
|
|
|
|
elasticsearch_container_ports: ~
|
|
|
|
elasticsearch_container_labels:
|
|
|
|
version: "{{ elasticsearch_version }}"
|
|
|
|
elasticsearch_container_ulimits:
|
|
|
|
# - "memlock:{{ (1.5 * 1024 * elasticsearch_allocated_ram_mb) | int }}:{{ (1.5 * 1024 * elasticsearch_allocated_ram_mb) | int }}"
|
|
|
|
- "memlock:-1:-1"
|
|
|
|
elasticsearch_container_volumes:
|
|
|
|
- "{{ elasticsearch_data_path }}:/usr/share/elasticsearch/data:z"
|
|
|
|
elasticsearch_container_networks: ~
|
|
|
|
elasticsearch_container_purge_networks: ~
|
|
|
|
elasticsearch_container_restart_policy: unless-stopped
|
2024-10-28 19:24:14 +00:00
|
|
|
elasticsearch_container_state: >-2
|
|
|
|
{{ (elasticsearch_state == 'present') | ternary('started', 'absent') }}
|