From bd17d1f704fcb9b6a83e8b7482ed6590a4f0774e Mon Sep 17 00:00:00 2001 From: Jonathan Strootman Date: Wed, 27 Jul 2016 15:27:49 -0700 Subject: [PATCH 1/5] Removed unused version locking file --- tasks/elasticsearch-version-lock.yml | 10 ---------- 1 file changed, 10 deletions(-) delete mode 100644 tasks/elasticsearch-version-lock.yml diff --git a/tasks/elasticsearch-version-lock.yml b/tasks/elasticsearch-version-lock.yml deleted file mode 100644 index 7189203..0000000 --- a/tasks/elasticsearch-version-lock.yml +++ /dev/null @@ -1,10 +0,0 @@ ---- -# Trigger Debian section -- name: Include Debian specific Elasticsearch - include: elasticsearch-Debian-version-lock.yml - when: ansible_os_family == 'Debian' - -# Trigger Redhat section -- name: Include RedHat specific Elasticsearch - include: elasticsearch-RedHat-version-lock.yml - when: ansible_os_family == 'RedHat' From f4f242c7f4c53b3cfe866a6506a0461a30cf3611 Mon Sep 17 00:00:00 2001 From: Jonathan Strootman Date: Wed, 27 Jul 2016 15:29:23 -0700 Subject: [PATCH 2/5] Added version locking to Debian install --- tasks/elasticsearch-Debian.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tasks/elasticsearch-Debian.yml b/tasks/elasticsearch-Debian.yml index dba5fa5..d1f5975 100644 --- a/tasks/elasticsearch-Debian.yml +++ b/tasks/elasticsearch-Debian.yml @@ -13,6 +13,10 @@ apt_repository: repo="deb http://packages.elastic.co/elasticsearch/{{ es_major_version }}/debian stable main" state=present when: es_use_repository +- name: Debian - include versionlock + include: elasticsearch-Debian-version-lock.yml + when: es_version_lock + - name: Debian - Ensure elasticsearch is installed apt: name=elasticsearch{% if es_version is defined and es_version != "" %}={{ es_version }}{% endif %} state=present force={{force_install}} cache_valid_time=86400 when: es_use_repository From f599bbb3afcb9ca7424335ebbb963642675b190d Mon Sep 17 00:00:00 2001 From: Jonathan Strootman Date: Wed, 27 Jul 2016 15:44:01 -0700 Subject: [PATCH 3/5] Set ansible galaxy min version to `2.0` --- meta/main.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/meta/main.yml b/meta/main.yml index 1a0b068..ed29fb2 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -7,8 +7,7 @@ galaxy_info: description: Elasticsearch for Linux company: "Elastic.co" license: "license (Apache)" - # Require 1.6 for apt deb install - min_ansible_version: 1.6 + min_ansible_version: 2.0 platforms: - name: EL versions: From 8e31cfbacf6f553893a1d47393d875ad97d3dd47 Mon Sep 17 00:00:00 2001 From: Bob Breznak Date: Wed, 3 Aug 2016 14:48:34 -0400 Subject: [PATCH 4/5] Make the Upstart script consistent with the systemd script --- templates/init/debian/elasticsearch.j2 | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/templates/init/debian/elasticsearch.j2 b/templates/init/debian/elasticsearch.j2 index 1c47643..a19153e 100755 --- a/templates/init/debian/elasticsearch.j2 +++ b/templates/init/debian/elasticsearch.j2 @@ -45,11 +45,11 @@ fi # The following variables can be overwritten in $DEFAULT # Run Elasticsearch as this user ID and group ID -ES_USER=elasticsearch -ES_GROUP=elasticsearch +ES_USER={{es_user}} +ES_GROUP={{es_group}} # Directory where the Elasticsearch binary distribution resides -ES_HOME=/usr/share/$NAME +ES_HOME={{es_home}} # Heap size defaults to 256m min, 1g max # Set ES_HEAP_SIZE to 50% of available RAM, but no more than 31g @@ -71,13 +71,13 @@ MAX_OPEN_FILES=65535 #MAX_LOCKED_MEMORY= # Elasticsearch log directory -LOG_DIR=/var/log/$NAME +LOG_DIR={{log_dir}} # Elasticsearch data directory -DATA_DIR=/var/lib/$NAME +DATA_DIR={{ data_dirs | array_to_str }} # Elasticsearch configuration directory -CONF_DIR=/etc/$NAME +CONF_DIR={{conf_dir}} # Maximum number of VMA (Virtual Memory Areas) a process can own MAX_MAP_COUNT=262144 @@ -86,7 +86,7 @@ MAX_MAP_COUNT=262144 #ES_GC_LOG_FILE=/var/log/elasticsearch/gc.log # Elasticsearch PID file directory -PID_DIR="/var/run/elasticsearch" +PID_DIR={{pid_dir}} # End of variables that can be overwritten in $DEFAULT @@ -103,7 +103,7 @@ fi # Define other required variables PID_FILE="$PID_DIR/$NAME.pid" -DAEMON=$ES_HOME/bin/elasticsearch +DAEMON={{es_home}}/bin/elasticsearch DAEMON_OPTS="-d -p $PID_FILE --default.path.home=$ES_HOME --default.path.logs=$LOG_DIR --default.path.data=$DATA_DIR --default.path.conf=$CONF_DIR" export ES_HEAP_SIZE @@ -227,4 +227,4 @@ case "$1" in ;; esac -exit 0 \ No newline at end of file +exit 0 From f471622348f331824e9b945492bd6a32be7b3360 Mon Sep 17 00:00:00 2001 From: Jakob Reiter Date: Wed, 10 Aug 2016 18:17:34 +0200 Subject: [PATCH 5/5] Extended check for which openjdk version to use. Needed because ubuntu 16.04 does not provide openjdk-7 packages anymore, which was the default package. Now uses openjdk-8 package if ubuntu version >= 15.10 --- vars/Debian.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vars/Debian.yml b/vars/Debian.yml index 7725f49..cfa73ae 100644 --- a/vars/Debian.yml +++ b/vars/Debian.yml @@ -1,4 +1,4 @@ --- -java: "{{ es_java | default('openjdk-7-jre-headless') }}" +java: "{% if es_java is defined %}{{es_java}}{%elif (ansible_distribution == 'Ubuntu' and ansible_distribution_version | version_compare('15.10', '>=')) %}openjdk-8-jre-headless{% else %}openjdk-7-jre-headless{% endif %}" default_file: "/etc/default/elasticsearch" -es_home: "/usr/share/elasticsearch" \ No newline at end of file +es_home: "/usr/share/elasticsearch"