Ansible roles by Evolix
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
ansible-roles/elasticsearch/tasks/packages.yml

64 lines
1.2 KiB

---
- name: APT https transport is enabled
apt:
name: apt-transport-https
state: present
tags:
- elasticsearch
- packages
- name: Look for legacy apt keyring
stat:
path: /etc/apt/trusted.gpg
register: _trusted_gpg_keyring
tags:
- elasticsearch
- packages
- name: Elastic embedded GPG key is absent
apt_key:
id: "D88E42B4"
keyring: /etc/apt/trusted.gpg
state: absent
when: _trusted_gpg_keyring.stat.exists
tags:
- elasticsearch
- packages
- name: Elastic GPG key is installed
copy:
src: elastic.asc
dest: /etc/apt/trusted.gpg.d/elastic.asc
force: yes
mode: "0644"
owner: root
group: root
tags:
- elasticsearch
- packages
- name: Elastic sources list is available
apt_repository:
repo: "deb https://artifacts.elastic.co/packages/{{ elastic_stack_version | mandatory }}/apt stable main"
filename: elastic
state: present
update_cache: yes
tags:
- elasticsearch
- packages
- name: Elasticsearch is installed
apt:
name: elasticsearch
state: present
tags:
- elasticsearch
- packages
- name: Elasticsearch service is enabled
service:
name: elasticsearch
enabled: yes
tags:
- elasticsearch