mirror of
https://github.com/famedly/ansible-collection-services
synced 2024-11-10 05:54:14 +00:00
feat(zammad): support limiting elasticsearch memory
This commit is contained in:
parent
40eee20240
commit
17d1535d3a
4 changed files with 19 additions and 4 deletions
|
@ -20,6 +20,9 @@ zammad_network:
|
|||
zammad_host_network: ~
|
||||
zammad_allow_host_nework: ~
|
||||
|
||||
zammad_elastic_max_mem_in_mb: 512
|
||||
zammad_elastic_min_mem_in_mb: 256
|
||||
|
||||
# The container order is *very* important!
|
||||
zammad_containers:
|
||||
- name: "zammad-postgresql"
|
||||
|
@ -62,6 +65,9 @@ zammad_containers:
|
|||
networks:
|
||||
- name: "{{ zammad_network.name }}"
|
||||
add_host_network: "{{ zammad_allow_host_nework.elasticsearch | default(False) }}"
|
||||
memory_limit: "{{ zammad_elastic_max_mem_in_mb }}M"
|
||||
env:
|
||||
ES_JAVA_OPTS: "-Xms{{ zammad_elastic_min_mem_in_mb }}m -Xmx{{ zammad_elastic_max_mem_in_mb }}m"
|
||||
|
||||
- name: "zammad-websocket"
|
||||
image_name: "{{ zammad_container_repo }}"
|
||||
|
|
|
@ -39,6 +39,16 @@
|
|||
notify: Restart elasticsearch
|
||||
loop: "{{ zammad_elasticsearch_files }}"
|
||||
|
||||
- name: Template elasticsearch jvm options
|
||||
template:
|
||||
src: jvm.options.j2
|
||||
dest: "{{ zammad_base_path }}/elasticsearch-config/jvm.options"
|
||||
owner: "{{ zammad_user_res.uid }}"
|
||||
group: "{{ zammad_user_res.group }}"
|
||||
mode: "0660"
|
||||
tags: [ 'prepare', 'prepare-zammad' ]
|
||||
notify: Restart elasticsearch
|
||||
|
||||
- name: Template fake /etc/passwd for postgres
|
||||
template:
|
||||
src: postgres-passwd.j2
|
||||
|
@ -91,6 +101,7 @@
|
|||
labels: "{{ container.labels | default(omit) }}"
|
||||
volumes: "{{ container.volumes | default(omit) }}"
|
||||
restart_policy: "{{ container.restart_policy }}"
|
||||
memory: "{{ container.memory_limit | default(omit) }}"
|
||||
state: "{{ container.state | default('started') }}"
|
||||
comparisons:
|
||||
networks: strict
|
||||
|
|
|
@ -19,8 +19,8 @@
|
|||
# Xms represents the initial size of total heap space
|
||||
# Xmx represents the maximum size of total heap space
|
||||
|
||||
-Xms1g
|
||||
-Xmx1g
|
||||
-Xms{{ zammad_elastic_min_mem_in_mb }}m
|
||||
-Xmx{{ zammad_elastic_max_mem_in_mb }}m
|
||||
|
||||
################################################################
|
||||
## Expert settings
|
|
@ -17,8 +17,6 @@ zammad_directories:
|
|||
zammad_elasticsearch_files:
|
||||
- src: elasticsearch.yml
|
||||
mode: 660
|
||||
- src: jvm.options
|
||||
mode: 660
|
||||
- src: log4j2.properties
|
||||
mode: 660
|
||||
|
||||
|
|
Loading…
Reference in a new issue