Commit d8500204 by e0d

Code review comments.

parent bdee417c
- hosts: tag_role_elasticsearch:&tag_environment_stage
- hosts: tag_play_elasticsearch:&tag_environment_stage:&tag_deployment_edx
sudo: True
vars_files:
- "{{ secure_dir }}/vars/common/common.yml"
......
......@@ -2,13 +2,15 @@
elasticsearch_app_dir: "{{ COMMON_APP_DIR }}/elasticsearch"
elasticsearch_data_dir: "{{ COMMON_DATA_DIR }}/elasticsearch"
elasticsearch_log_dir: "{{ COMMON_LOG_DIR }}/elasticsearch"
elasticsearch_cfg_dir: "{{ COMMON_CFG_DIR }}/elasticsearch"
elasticsearch_version: "0.90.11"
elasticsearch_sha: "8e81388d0ba7e427b42514d96e25ba6499024c24"
elasticsearch_file: "elasticsearch-{{ elasticsearch_version }}.deb"
elasticsearch_url: "https://download.elasticsearch.org/elasticsearch/elasticsearch/{{ elasticsearch_file }}"
elasticsearch_aws_stack_name: "stage-edx"
elasticsearch_user: "elasticsearch"
elasticsearch_group: "elasticsearch"
#
# Defaults for a single server installation.
ELASTICSEARCH_CLUSTERED: false
ELASTICSEARCH_CLUSTERED: true
ELASTICSEARCH_HEAP_SIZE: "512m"
\ No newline at end of file
......@@ -8,16 +8,17 @@
# * oraclejdk
#
# Example play:
# This play can be used to do a single server or clustered
#
# This role can be used to do a single-server or clustered
# installation of the elasticsearch service. When a cluster
# is being installed, there are two important things that
# you must know.
# The ELASTICSEARCH_CLUSTERED var must by true.
# The ELASTICSEARCH_CLUSTERED var must be true.
# All hosts targeted by your play will be cluster peers.
# Elasticsearch will determine who that master should be.
# Elasticsearch will determine who the master should be.
#
# Ansible provides handy set operators for use in the
# plays host declaration, as seen in the following example.
#
......@@ -27,6 +28,7 @@
# - oraclejdk
# - elasticsearch
#
- name: download elasticsearch
get_url: >
url={{ elasticsearch_url }}
......@@ -37,7 +39,18 @@
shell: >
dpkg -i --force-confold /var/tmp/elasticsearch-{{ elasticsearch_version }}.deb
executable=/bin/bash
- name: create directories
file: >
path="{{ item }}"
state=directory
owner="{{ elasticsearch_user }}"
group="{{ elasticsearch_group }}"
with_items:
- "{{ elasticsearch_data_dir }}"
- "{{ elasticsearch_log_dir }}"
- "{{ elasticsearch_cfg_dir }}"
- name: update elasticsearch defaults
template: >
src=etc/default/elasticsearch.j2 dest=/etc/default/elasticsearch
......@@ -45,7 +58,8 @@
- name: drop the elasticsearch config
template: >
src=etc/elasticsearch/elasticsearch.yml.j2 dest=/etc/elasticsearch/elasticsearch.yml
src=edx/etc/elasticsearch/elasticsearch.yml.j2 dest={{ elasticsearch_cfg_dir }}/elasticsearch.yml
mode=0744
when: ELASTICSEARCH_CLUSTERED
- name: Ensure elasticsearch is enabled and started
......
# {{ ansible_managed }}
# Run ElasticSearch as this user ID and group ID
#ES_USER=elasticsearch
#ES_GROUP=elasticsearch
......@@ -20,19 +23,19 @@ ES_HEAP_SIZE={{ ELASTICSEARCH_HEAP_SIZE }}
#MAX_LOCKED_MEMORY=unlimited
# ElasticSearch log directory
#LOG_DIR=/var/log/elasticsearch
LOG_DIR={{ elasticsearch_log_dir }}
# ElasticSearch data directory
#DATA_DIR=/var/lib/elasticsearch
DATA_DIR={{ COMMON_DATA_DIR }}
# ElasticSearch work directory
#WORK_DIR=/tmp/elasticsearch
# ElasticSearch configuration directory
#CONF_DIR=/etc/elasticsearch
CONF_DIR={{ elasticsearch_cfg_dir }}
# ElasticSearch configuration file (elasticsearch.yml)
#CONF_FILE=/etc/elasticsearch/elasticsearch.yml
# CONF_FILE=/etc/elasticsearch/elasticsearch.yml
# Additional Java OPTS
#ES_JAVA_OPTS=
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment