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 sudo: True
vars_files: vars_files:
- "{{ secure_dir }}/vars/common/common.yml" - "{{ secure_dir }}/vars/common/common.yml"
......
...@@ -2,13 +2,15 @@ ...@@ -2,13 +2,15 @@
elasticsearch_app_dir: "{{ COMMON_APP_DIR }}/elasticsearch" elasticsearch_app_dir: "{{ COMMON_APP_DIR }}/elasticsearch"
elasticsearch_data_dir: "{{ COMMON_DATA_DIR }}/elasticsearch" elasticsearch_data_dir: "{{ COMMON_DATA_DIR }}/elasticsearch"
elasticsearch_log_dir: "{{ COMMON_LOG_DIR }}/elasticsearch" elasticsearch_log_dir: "{{ COMMON_LOG_DIR }}/elasticsearch"
elasticsearch_cfg_dir: "{{ COMMON_CFG_DIR }}/elasticsearch"
elasticsearch_version: "0.90.11" elasticsearch_version: "0.90.11"
elasticsearch_sha: "8e81388d0ba7e427b42514d96e25ba6499024c24" elasticsearch_sha: "8e81388d0ba7e427b42514d96e25ba6499024c24"
elasticsearch_file: "elasticsearch-{{ elasticsearch_version }}.deb" elasticsearch_file: "elasticsearch-{{ elasticsearch_version }}.deb"
elasticsearch_url: "https://download.elasticsearch.org/elasticsearch/elasticsearch/{{ elasticsearch_file }}" 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. # Defaults for a single server installation.
ELASTICSEARCH_CLUSTERED: false ELASTICSEARCH_CLUSTERED: true
ELASTICSEARCH_HEAP_SIZE: "512m" ELASTICSEARCH_HEAP_SIZE: "512m"
\ No newline at end of file
...@@ -8,16 +8,17 @@ ...@@ -8,16 +8,17 @@
# * oraclejdk # * oraclejdk
# #
# Example play: # 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 # installation of the elasticsearch service. When a cluster
# is being installed, there are two important things that # is being installed, there are two important things that
# you must know. # 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. # 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 # Ansible provides handy set operators for use in the
# plays host declaration, as seen in the following example. # plays host declaration, as seen in the following example.
# #
...@@ -27,6 +28,7 @@ ...@@ -27,6 +28,7 @@
# - oraclejdk # - oraclejdk
# - elasticsearch # - elasticsearch
# #
- name: download elasticsearch - name: download elasticsearch
get_url: > get_url: >
url={{ elasticsearch_url }} url={{ elasticsearch_url }}
...@@ -37,7 +39,18 @@ ...@@ -37,7 +39,18 @@
shell: > shell: >
dpkg -i --force-confold /var/tmp/elasticsearch-{{ elasticsearch_version }}.deb dpkg -i --force-confold /var/tmp/elasticsearch-{{ elasticsearch_version }}.deb
executable=/bin/bash 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 - name: update elasticsearch defaults
template: > template: >
src=etc/default/elasticsearch.j2 dest=/etc/default/elasticsearch src=etc/default/elasticsearch.j2 dest=/etc/default/elasticsearch
...@@ -45,7 +58,8 @@ ...@@ -45,7 +58,8 @@
- name: drop the elasticsearch config - name: drop the elasticsearch config
template: > 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 when: ELASTICSEARCH_CLUSTERED
- name: Ensure elasticsearch is enabled and started - name: Ensure elasticsearch is enabled and started
......
# {{ ansible_managed }}
# Run ElasticSearch as this user ID and group ID # Run ElasticSearch as this user ID and group ID
#ES_USER=elasticsearch #ES_USER=elasticsearch
#ES_GROUP=elasticsearch #ES_GROUP=elasticsearch
...@@ -20,19 +23,19 @@ ES_HEAP_SIZE={{ ELASTICSEARCH_HEAP_SIZE }} ...@@ -20,19 +23,19 @@ ES_HEAP_SIZE={{ ELASTICSEARCH_HEAP_SIZE }}
#MAX_LOCKED_MEMORY=unlimited #MAX_LOCKED_MEMORY=unlimited
# ElasticSearch log directory # ElasticSearch log directory
#LOG_DIR=/var/log/elasticsearch LOG_DIR={{ elasticsearch_log_dir }}
# ElasticSearch data directory # ElasticSearch data directory
#DATA_DIR=/var/lib/elasticsearch DATA_DIR={{ COMMON_DATA_DIR }}
# ElasticSearch work directory # ElasticSearch work directory
#WORK_DIR=/tmp/elasticsearch #WORK_DIR=/tmp/elasticsearch
# ElasticSearch configuration directory # ElasticSearch configuration directory
#CONF_DIR=/etc/elasticsearch CONF_DIR={{ elasticsearch_cfg_dir }}
# ElasticSearch configuration file (elasticsearch.yml) # ElasticSearch configuration file (elasticsearch.yml)
#CONF_FILE=/etc/elasticsearch/elasticsearch.yml # CONF_FILE=/etc/elasticsearch/elasticsearch.yml
# Additional Java OPTS # Additional Java OPTS
#ES_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