Just a side note: kohadevbox follows exactly those steps. but I just noticed it is pointing to a different ES debian repo so ES is a bit outdated (5.0 vs 5.3). I'll fix that ASAP.
This is what we are doing. The thing I like about Ansible is that the YAML notation is easy to read and self explanatory! (note we still pick Oracle's JRE, because I read it was recommended on the ES page, but might be worth moving back to openjdk):
---
- name: Elasticsearch {{ elasticsearch_version }} | Add Oracle Java 8 repository (key)
apt_key:
id: 7B2C3B0889BF5709A105D03AC2518248EEA14886
state: present
- name: Elasticsearch {{ elasticsearch_version }} | Add Oracle Java 8 repository (repo)
apt_repository:
state: present
update_cache: yes
- name: Elasticsearch {{ elasticsearch_version }} | Accept Oracle license
shell: echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | /usr/bin/debconf-set-selections
- name: Elasticsearch {{ elasticsearch_version }} | Install Oracle Java 8
apt:
name: oracle-java8-installer
state: latest
- name: Elasticsearch {{ elasticsearch_version }} | Add Elasticsearch repository (key)
apt_key:
state: present
- name: Elasticsearch {{ elasticsearch_version }} | Add Elasticsearch repository (repo)
apt_repository:
state: present
- name: Elasticsearch {{ elasticsearch_version }} | Install Elasticsearch
apt:
name: elasticsearch
state: latest
force: yes
- name: Elasticsearch {{ elasticsearch_version }} | Run Elasticsearch on startup
service:
name: elasticsearch
enabled: yes
state: started
- name: Elasticsearch {{ elasticsearch_version }} | Install Koha's Elasticsearch deps
apt:
name: koha-elasticsearch
state: latest