Fix version_compare usage
This commit is contained in:
parent
523270405e
commit
65238c74bd
6 changed files with 13 additions and 13 deletions
|
|
@ -48,18 +48,18 @@
|
|||
- name: Copy Logging.yml File for Instance
|
||||
template: src=logging.yml.j2 dest={{conf_dir}}/logging.yml owner={{ es_user }} group={{ es_group }} mode=0644 force=yes
|
||||
notify: restart elasticsearch
|
||||
when: es_version | version_compare('2.0', '<=')
|
||||
when: es_version | version_compare('5.0', '<')
|
||||
|
||||
- name: Copy log4j2.properties File for Instance
|
||||
template: src=log4j2.properties.j2 dest={{conf_dir}}/log4j2.properties owner={{ es_user }} group={{ es_group }} mode=0644 force=yes
|
||||
notify: restart elasticsearch
|
||||
when: es_version | version_compare('2.0', '>')
|
||||
when: es_version | version_compare('5.0', '>=')
|
||||
|
||||
# Copy the JVM Options (5.x only)
|
||||
- name: Copy jvm.options File for Instance
|
||||
template: src=jvm.options.j2 dest={{conf_dir}}/jvm.options owner={{ es_user }} group={{ es_group }} mode=0644 force=yes
|
||||
notify: restart elasticsearch
|
||||
when: es_version | version_compare('2.0', '>')
|
||||
when: es_version | version_compare('5.0', '>=')
|
||||
|
||||
#Clean up un-wanted package scripts to avoid confusion
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ 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 %}
|
||||
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue