roles/elasticsearch: Add Elasticsearch deployment
The *elasticsearch* role installs Elasticsearch from the Elastic.co Yum repository and manages basic node configuration.
This commit is contained in:
41
roles/elasticsearch/tasks/main.yml
Normal file
41
roles/elasticsearch/tasks/main.yml
Normal file
@@ -0,0 +1,41 @@
|
||||
- name: ensure java is installed
|
||||
package:
|
||||
name=java-1.8.0-openjdk-headless
|
||||
state=present
|
||||
tags:
|
||||
- install
|
||||
|
||||
- name: ensure elasticsearch package repository is available
|
||||
template:
|
||||
src=elasticsearch.repo.j2
|
||||
dest=/etc/yum.repos.d/elasticsearch.repo
|
||||
mode=0644
|
||||
tags:
|
||||
- install
|
||||
|
||||
- name: Ensure elasticsearch is installed
|
||||
package:
|
||||
name: 'elasticsearch'
|
||||
state: present
|
||||
tags:
|
||||
- install
|
||||
|
||||
- name: ensure elasticsearch logging is configured
|
||||
template:
|
||||
src=log4j2.properties.j2
|
||||
dest=/etc/elasticsearch/log4j2.properties
|
||||
mode=0640
|
||||
owner=root
|
||||
group=elasticsearch
|
||||
|
||||
- name: ensure elasticsearch jvm options are set
|
||||
template:
|
||||
src=jvm.options.j2
|
||||
dest=/etc/elasticsearch/jvm.options
|
||||
mode=0644
|
||||
notify: restart elasticsearch
|
||||
|
||||
- name: ensure elasticsearch server starts at boot
|
||||
service:
|
||||
name=elasticsearch
|
||||
enabled=yes
|
||||
Reference in New Issue
Block a user