ansible-roles/elasticsearch/tasks/bootstrap_checks.yml
Jérémy Lecour 5027151011
All checks were successful
Ansible Lint |Total|New|Outstanding|Fixed|Trend |:-:|:-:|:-:|:-:|:-: |2789|5|2784|7|:+1: Reference build: <a href="https://jenkins.evolix.org/job/gitea/job/ansible-roles/job/unstable/263//ansiblelint">Evolix » ansible-roles » unstable #263</a>
gitea/ansible-roles/pipeline/head This commit looks good
elasticsearch: use an Integer
2023-05-31 17:25:27 +02:00

45 lines
1.1 KiB
YAML

---
- name: Read maximum map count
ansible.builtin.command:
cmd: "sysctl -n vm.max_map_count"
register: max_map_count
failed_when: False
changed_when: False
tags:
- config
- name: Maximum map count check
ansible.posix.sysctl:
name: vm.max_map_count
value: "262144"
sysctl_file: /etc/sysctl.d/elasticsearch.conf
when: max_map_count | int < 262144
tags:
- config
- name: bootstrap.memory_lock
ansible.builtin.lineinfile:
dest: /etc/elasticsearch/elasticsearch.yml
line: "bootstrap.memory_lock: true"
regexp: "^bootstrap.memory_lock:"
insertafter: "^# *bootstrap.memory_lock:"
tags:
- config
- name: Create a system config directory for systemd overrides
ansible.builtin.file:
path: /etc/systemd/system/elasticsearch.service.d
state: directory
- name: Override memory config in systemd unit
community.general.ini_file:
dest: /etc/systemd/system/elasticsearch.service.d/elasticsearch.conf
section: Service
option: "LimitMEMLOCK"
value: "infinity"
notify:
- restart elasticsearch
tags:
- config