---
- name: Add Elasticsearch GPG key.
  rpm_key:
    key: https://artifacts.elastic.co/GPG-KEY-elasticsearch
    state: present

- name: Add Elasticsearch repository.
  template:
    src: elasticsearch.repo.j2
    dest: /etc/yum.repos.d/elasticsearch.repo
    mode: 0644
