2015-05-13 09:45:55 +02:00
|
|
|
---
|
2015-05-15 10:53:27 +02:00
|
|
|
- name: Ensure libselinux-python on CentOS 6.x
|
|
|
|
|
yum: name=libselinux-python state=present update_cache=yes
|
|
|
|
|
when: ( ansible_distribution == "CentOS" ) and ( ansible_distribution_major_version == "6" )
|
2015-05-13 09:45:55 +02:00
|
|
|
- name: RedHat - add Elasticsearch repo
|
2015-05-13 13:33:43 +02:00
|
|
|
template: src=elasticsearch.repo dest=/etc/yum.repos.d/elasticsearch-{{ es_major_version }}.repo
|
2015-07-07 11:28:46 +02:00
|
|
|
- name: RedHat - Install Elasticsearch with minor version supplied
|
|
|
|
|
when: es_version != ""
|
2015-05-13 13:33:43 +02:00
|
|
|
yum: name=elasticsearch-{{ es_version }} state=present update_cache=yes
|
2015-05-13 09:45:55 +02:00
|
|
|
register: elasticsearch_install
|
2015-07-07 11:28:46 +02:00
|
|
|
- name: RedHat - Install Elasticsearch without minor version supplied
|
|
|
|
|
when: es_version == ""
|
|
|
|
|
yum: name=elasticsearch state=present update_cache=yes
|
|
|
|
|
register: elasticsearch_install
|
2015-05-13 09:45:55 +02:00
|
|
|
|
2015-05-22 21:11:33 +02:00
|
|
|
- name: RedHat - configure memory
|
2015-07-06 16:17:34 +02:00
|
|
|
lineinfile: dest=/etc/sysconfig/elasticsearch regexp="^ES_HEAP_SIZE" insertafter="^#ES_HEAP_SIZE" line="ES_HEAP_SIZE={{ es_heap_size }}"
|
2015-05-22 21:11:33 +02:00
|
|
|
when: es_heap_size is defined
|
|
|
|
|
register: elasticsearch_configure
|
2015-05-23 14:38:13 +02:00
|
|
|
- name: RedHat - configure data store
|
2015-07-06 16:17:34 +02:00
|
|
|
lineinfile: dest=/etc/sysconfig/elasticsearch regexp="^DATA_DIR" insertafter="^#DATA_DIR" line="DATA_DIR={{ es_data_dir }}"
|
2015-05-23 14:38:13 +02:00
|
|
|
when: es_data_dir is defined
|
|
|
|
|
register: elasticsearch_configure
|
|
|
|
|
- name: RedHat - configure elasticsearch user
|
2015-07-06 16:17:34 +02:00
|
|
|
lineinfile: dest=/etc/sysconfig/elasticsearch regexp="^ES_USER" insertafter="^#ES_USER" line="ES_USER={{ es_user }}"
|
2015-05-23 14:38:13 +02:00
|
|
|
when: es_user is defined
|
|
|
|
|
register: elasticsearch_configure
|
|
|
|
|
- name: RedHat - configure elasticsearch group
|
2015-07-06 16:17:34 +02:00
|
|
|
lineinfile: dest=/etc/sysconfig/elasticsearch regexp="^ES_GROUP" insertafter="^#ES_GROUP" line="ES_GROUP={{ es_group }}"
|
2015-05-23 14:38:13 +02:00
|
|
|
when: es_group is defined
|
|
|
|
|
register: elasticsearch_configure
|
|
|
|
|
- name: RedHat - create data dir
|
|
|
|
|
file: state=directory path={{ es_data_dir }} owner={{ es_user }} group={{ es_group }}
|
|
|
|
|
when: es_data_dir is defined
|