Fix version_compare usage

This commit is contained in:
Maarten Bezemer 2016-11-04 16:04:31 +01:00
parent 523270405e
commit 65238c74bd
6 changed files with 13 additions and 13 deletions

View file

@ -14,7 +14,7 @@ DATA_DIR={{ data_dirs | array_to_str }}
# Elasticsearch logs directory
LOG_DIR={{log_dir}}
{% if es_version | version_compare('2.0', '<=') %}
{% if es_version | version_compare('5.0', '<') %}
# Elasticsearch work directory
WORK_DIR={{work_dir}}
{% endif %}
@ -22,7 +22,7 @@ WORK_DIR={{work_dir}}
# Elasticsearch PID directory
PID_DIR={{pid_dir}}
{% if es_version | version_compare('2.0', '<=') %}
{% if es_version | version_compare('5.0', '<') %}
# Heap size defaults to 256m min, 1g max
# Set ES_HEAP_SIZE to 50% of available RAM, but no more than 31g
{% if es_heap_size is defined %}
@ -78,7 +78,7 @@ MAX_OPEN_FILES={{es_max_open_files}}
{% endif %}
# The maximum number of bytes of memory that may be locked into RAM
# Set to "unlimited" if you use the 'bootstrap.{% if es_version | version_compare('2.0', '>') %}memory_lock{% else %}mlockall{% endif %}: true' option
# Set to "unlimited" if you use the 'bootstrap.{% if es_version | version_compare('5.0', '<=') %}memory_lock{% else %}mlockall{% endif %}: true' option
# in elasticsearch.yml (ES_HEAP_SIZE must also be set).
# When using Systemd, the LimitMEMLOCK property must be set
# in /usr/lib/systemd/system/elasticsearch.service

View file

@ -18,8 +18,8 @@ path.conf: {{ conf_dir }}
path.data: {{ data_dirs | array_to_str }}
{% if es_version | version_compare('2.0', '<=') %}
{% if es_version | version_compare('5.0', '<') %}
path.work: {{ work_dir }}
{% endif %}
path.logs: {{ log_dir }}
path.logs: {{ log_dir }}

View file

@ -104,7 +104,7 @@ fi
# Define other required variables
PID_FILE="$PID_DIR/$NAME.pid"
DAEMON={{es_home}}/bin/elasticsearch
{% if es_version | version_compare('2.0', '<=') %}
{% if es_version | version_compare('5.0', '<') %}
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"
{% else %}
DAEMON_OPTS="-d -p $PID_FILE -Edefault.path.home=$ES_HOME -Edefault.path.logs=$LOG_DIR -Edefault.path.data=$DATA_DIR -Edefault.path.conf=$CONF_DIR"

View file

@ -3,7 +3,7 @@
# elasticsearch <summary>
#
# chkconfig: 2345 80 20
# description: Starts and stops a single elasticsearch instance on this system
# description: Starts and stops a single elasticsearch instance on this system
#
### BEGIN INIT INFO
@ -116,7 +116,7 @@ start() {
cd $ES_HOME
echo -n $"Starting $prog: "
# if not running, start it up here, usually something like "daemon $exec"
{% if es_version | version_compare('2.0', '<=') %}
{% if es_version | version_compare('5.0', '<') %}
daemon --user $ES_USER --pidfile $pidfile $exec -p $pidfile -d -Des.default.path.home=$ES_HOME -Des.default.path.logs=$LOG_DIR -Des.default.path.data=$DATA_DIR -Des.default.path.conf=$CONF_DIR
{% else %}
daemon --user $ES_USER --pidfile $pidfile $exec -p $pidfile -d -Edefault.path.home=$ES_HOME -Edefault.path.logs=$LOG_DIR -Edefault.path.data=${DATA_DIR} -Edefault.path.conf=$CONF_DIR

View file

@ -22,7 +22,7 @@ ExecStartPre=/usr/share/elasticsearch/bin/elasticsearch-systemd-pre-exec
{% endif %}
ExecStart={{es_home}}/bin/elasticsearch \
{% if es_version | version_compare('2.0', '<=') %}
{% if es_version | version_compare('5.0', '<') %}
-Des.pidfile=${PID_DIR}/elasticsearch.pid \
-Des.default.path.home=${ES_HOME} \
-Des.default.path.logs=${LOG_DIR} \
@ -45,7 +45,7 @@ StandardError=inherit
LimitNOFILE={{es_max_open_files}}
# Specifies the maximum number of bytes of memory that may be locked into RAM
# Set to "infinity" if you use the 'bootstrap.{% if es_version | version_compare('2.0', '>') %}memory_lock{% else %}mlockall{% endif %}: true' option
# Set to "infinity" if you use the 'bootstrap.{% if es_version | version_compare('5.0', '<=') %}memory_lock{% else %}mlockall{% endif %}: true' option
# in elasticsearch.yml and 'MAX_LOCKED_MEMORY=unlimited' in {{instance_default_file}}
{% if m_lock_enabled %}
LimitMEMLOCK=infinity