--- - name: Set heap size ansible.builtin.lineinfile: path: /etc/elasticsearch/jvm.options regexp: "^-{{ item }}" line: "-{{ item }}{{ elasticsearch_heap_size }}" loop: - Xms - Xmx notify: Restart elasticsearch tags: elasticsearch - name: Copy config file ansible.builtin.copy: content: "{{ elasticsearch_full_config | to_yaml }}" dest: /etc/elasticsearch/elasticsearch.yml owner: root group: elasticsearch mode: 0640 notify: Restart elasticsearch tags: elasticsearch