ansible-role-elasticsearch/tasks/config.yml

44 lines
1.2 KiB
YAML
Raw Normal View History

2020-02-09 14:15:24 +00:00
---
2023-07-05 09:36:13 +00:00
- name: Set heap size
2022-04-07 12:55:14 +00:00
ansible.builtin.lineinfile:
2020-02-09 14:15:24 +00:00
path: /etc/elasticsearch/jvm.options
2023-07-05 09:36:13 +00:00
regexp: "^-{{ item }}"
line: "-{{ item }}{{ elasticsearch_heap_size }}"
2020-02-09 14:15:24 +00:00
loop:
- Xms
- Xmx
2023-07-05 09:36:13 +00:00
notify: Restart elasticsearch
2020-02-09 14:15:24 +00:00
tags: elasticsearch
2023-11-13 15:24:05 +00:00
- name: Copy SSL certificate
ansible.builtin.copy:
content: "{{ elasticsearch_ssl_certificate }}"
dest: "{{ elasticsearch_full_config['xpack.security.transport.ssl.certificate'] }}"
owner: root
group: elasticsearch
mode: "0640"
when: "'xpack.security.transport.ssl.certificate' in elasticsearch_full_config"
notify: Restart elasticsearch
tags: elasticsearch
- name: Copy SSL key
ansible.builtin.copy:
content: "{{ elasticsearch_ssl_key }}"
dest: "{{ elasticsearch_full_config['xpack.security.transport.ssl.key'] }}"
owner: root
group: elasticsearch
mode: "0640"
when: "'xpack.security.transport.ssl.key' in elasticsearch_full_config"
notify: Restart elasticsearch
tags: elasticsearch
2023-07-05 09:36:13 +00:00
- name: Copy config file
2022-04-07 12:55:14 +00:00
ansible.builtin.copy:
2023-07-05 09:36:13 +00:00
content: "{{ elasticsearch_full_config | to_yaml }}"
2020-02-09 14:15:24 +00:00
dest: /etc/elasticsearch/elasticsearch.yml
owner: root
group: elasticsearch
2023-11-13 15:24:05 +00:00
mode: "0640"
2023-07-05 09:36:13 +00:00
notify: Restart elasticsearch
2020-02-09 14:15:24 +00:00
tags: elasticsearch