---

- name: APT sources
  ansible.builtin.include_tasks: apt_sources.yml
  args:
    apply:
      tags:
        - elasticsearch
        - packages

- name: Elasticsearch is installed
  ansible.builtin.apt:
    name: elasticsearch
    state: present
    update_cache: yes
  tags:
    - elasticsearch
    - packages

- name: Elasticsearch service is enabled
  ansible.builtin.systemd:
    name: elasticsearch
    enabled: yes
  tags:
    - elasticsearch
