Commit b3d7a40c by Fred Smith

elasticsearch 1.5 - install from apt repo

parent b4f9738f
...@@ -3,14 +3,15 @@ elasticsearch_app_dir: "{{ COMMON_APP_DIR }}/elasticsearch" ...@@ -3,14 +3,15 @@ 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_cfg_dir: "{{ COMMON_CFG_DIR }}/elasticsearch"
elasticsearch_version: "0.90.11" elasticsearch_apt_key: "46095ACC8548582C1A2699A9D27D666CD88E42B4"
elasticsearch_sha: "8e81388d0ba7e427b42514d96e25ba6499024c24" elasticsearch_apt_keyserver: "ha.pool.sks-keyservers.net"
elasticsearch_file: "elasticsearch-{{ elasticsearch_version }}.deb" elasticsearch_repo: "deb http://packages.elasticsearch.org/elasticsearch/1.5/debian stable main"
elasticsearch_url: "https://download.elasticsearch.org/elasticsearch/elasticsearch/{{ elasticsearch_file }}" elasticsearch_package_name: "elasticsearch"
elasticsearch_user: "elasticsearch" elasticsearch_user: "elasticsearch"
elasticsearch_group: "elasticsearch" elasticsearch_group: "elasticsearch"
# #
# Defaults for a single server installation. # Defaults for a single server installation.
ELASTICSEARCH_CLUSTERED: false ELASTICSEARCH_CLUSTER_MEMBERS: []
ELASTICSEARCH_HEAP_SIZE: "512m" ELASTICSEARCH_HEAP_SIZE: "512m"
ELASTICSEARCH_VERSION: "1.5.2"
...@@ -29,18 +29,32 @@ ...@@ -29,18 +29,32 @@
# - elasticsearch # - elasticsearch
# #
- name: download elasticsearch - name: Install Elasticsearch repo key
get_url: > apt_key: >
url={{ elasticsearch_url }} id={{ elasticsearch_apt_key }}
dest=/var/tmp/{{ elasticsearch_file }} keyserver={{ elasticsearch_apt_keyserver }}
force=no state=present
register: elasticsearch_reinstall tags:
- install
- install:base
- name: install elasticsearch from local package - name: Add Elasticsearch Repo
shell: > apt_repository: >
dpkg -i --force-confold /var/tmp/elasticsearch-{{ elasticsearch_version }}.deb repo='{{ elasticsearch_repo }}'
executable=/bin/bash state=present
when: elasticsearch_reinstall.changed tags:
- install
- install:base
- name: install elasticsearch
apt: >
pkg={{ elasticsearch_package_name }}={{ ELASTICSEARCH_VERSION }}
state=present install_recommends=yes
force=yes update_cache=yes
tags:
- install
- install:base
register: elasticsearch_reinstall
- name: create directories - name: create directories
file: > file: >
...@@ -52,24 +66,43 @@ ...@@ -52,24 +66,43 @@
- "{{ elasticsearch_data_dir }}" - "{{ elasticsearch_data_dir }}"
- "{{ elasticsearch_log_dir }}" - "{{ elasticsearch_log_dir }}"
- "{{ elasticsearch_cfg_dir }}" - "{{ elasticsearch_cfg_dir }}"
tags:
- install
- install:base
- 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
tags:
- install
- install:configuration
- name: drop the elasticsearch config - name: drop the elasticsearch config
template: > template: >
src=edx/etc/elasticsearch/elasticsearch.yml.j2 dest={{ elasticsearch_cfg_dir }}/elasticsearch.yml src=edx/etc/elasticsearch/elasticsearch.yml.j2 dest={{ elasticsearch_cfg_dir }}/elasticsearch.yml
mode=0744 mode=0744
tags:
- install
- install:configuration
- name: drop the elasticsearch logging config - name: drop the elasticsearch logging config
template: > template: >
src=edx/etc/elasticsearch/logging.yml.j2 dest={{ elasticsearch_cfg_dir }}/logging.yml src=edx/etc/elasticsearch/logging.yml.j2 dest={{ elasticsearch_cfg_dir }}/logging.yml
mode=0744 mode=0744
tags:
- install
- install:configuration
- name: Ensure elasticsearch is enabled and started - name: Ensure elasticsearch is enabled and started
service: name=elasticsearch state=started enabled=yes service: name=elasticsearch state=started enabled=yes
tags:
- manage
- manage:start
- name: Restart elastic when there has been an upgrade - name: Restart elastic when there has been an upgrade
service: name=elasticsearch state=restarted enabled=yes service: name=elasticsearch state=restarted enabled=yes
when: elasticsearch_reinstall.changed when: elasticsearch_reinstall.changed
tags:
- manage
- manage:restart
- install
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