From 62a85ef72af836b7b6715fc388f14f8a5f840b1d Mon Sep 17 00:00:00 2001 From: Jeremy Lecour Date: Tue, 20 Feb 2018 15:05:58 +0100 Subject: [PATCH] elasticsearch: RESTART_ON_UPGRADE is configurable --- CHANGELOG.md | 1 + elasticsearch/README.md | 5 +++-- elasticsearch/defaults/main.yml | 1 + elasticsearch/tasks/configuration.yml | 5 ++--- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8b280d27..44cd2006 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ The **patch** part changes incrmentally at each release. ### Changed * elasticsearch: use ES_TMPDIR variable for custom tmpdir, (from `/etc/default/elasticsearch` instead of changing `/etc/elesticsearch/jvm.options`). +* elasticsearch: RESTART_ON_UPGRADE is configurable (default: `true`) ### Fixed * nginx: fix basic auth for default vhost diff --git a/elasticsearch/README.md b/elasticsearch/README.md index a6fa0b14..9f968ae2 100644 --- a/elasticsearch/README.md +++ b/elasticsearch/README.md @@ -20,8 +20,9 @@ Tasks are extracted in several files, included in `tasks/main.yml` : * `elasticsearch_network_publish_host`: which interface to publish ; * `elasticsearch_custom_datadir`: custom datadir ; * `elasticsearch_custom_tmpdir`: custom tmpdir ; -* `elasticsearch_jvm_xms`: mininum heap size reserved for the JVM (defaults to 2g). -* `elasticsearch_jvm_xmx`: maximum heap size reserved for the JVM (defaults to 2g). +* `elasticsearch_jvm_xms`: mininum heap size reserved for the JVM (default: `2g`). +* `elasticsearch_jvm_xmx`: maximum heap size reserved for the JVM (default: `2g`). +* `elasticsearch_restart_on_upgrade`: restart the service after package upgrade (default: `true`) By default, Elasticsearch will listen to the public interfaces (`_site_` cf. https://www.elastic.co/guide/en/elasticsearch/reference/5.0/important-settings.html#network.host), so you will have to secure it, with firewall rules for example. diff --git a/elasticsearch/defaults/main.yml b/elasticsearch/defaults/main.yml index 33310a2f..02dd0d5a 100644 --- a/elasticsearch/defaults/main.yml +++ b/elasticsearch/defaults/main.yml @@ -11,6 +11,7 @@ elasticsearch_default_tmpdir: /var/lib/elasticsearch/tmp elasticsearch_jvm_xms: 2g elasticsearch_jvm_xmx: 2g elasticsearch_log_rotate_days: 365 +elasticsearch_restart_on_upgrade: True elasticsearch_curator: False diff --git a/elasticsearch/tasks/configuration.yml b/elasticsearch/tasks/configuration.yml index 3852cb41..9046687c 100644 --- a/elasticsearch/tasks/configuration.yml +++ b/elasticsearch/tasks/configuration.yml @@ -39,12 +39,11 @@ tags: - config -- name: Restart on upgrade +- name: Configure RESTART_ON_UPGRADE lineinfile: dest: /etc/default/elasticsearch - line: "RESTART_ON_UPGRADE=true" regexp: "^RESTART_ON_UPGRADE=" - insertafter: "^# *RESTART_ON_UPGRADE=true" + insertafter: "^# *RESTART_ON_UPGRADE=" tags: - config