NETWAYS / NETWAYS/ansible-collection-elasticstack

[Bug]: elasticsearch_jvm_custom_parameters is never applied

Open Beginner friendly
#494 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug component:elasticsearch
Dominant language
Jinja
Stars
14
Forks
11
Avg merge
1d 47m
Merged PRs (30d)
6

Description

The "Set jvm custom options" task in roles/elasticsearch/tasks/main.yml is gated by
when: elasticsearch_jvm_custom_parameters | bool, but the variable is meant to be a
list of JVM option lines (the template does {% for item in elasticsearch_jvm_custom_parameters %}).
A list is not a recognized boolean, so | bool returns False for any list — verified:
['-Xss1m'] | boolFalse. The task is therefore never executed and custom JVM
options are silently ignored. No value both passes | bool and is iterable, so the
variable is effectively dead.

Fix:

  • Remove elasticsearch_jvm_custom_parameters from defaults/main.yml — an optional list
    needs no default.
  • In meta/argument_specs.yml: type: list, elements: str, no default.
  • Change the task condition to when: elasticsearch_jvm_custom_parameters is defined
    (consistent with the other optional list variables).
To Reproduce

No response

Your Environment
  • Version (commit) used:
  • Ansible version:
  • Python version:
  • Operating System and version:

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with roles/elasticsearch/tasks/main.yml, defaults/main.yml, and meta/argument_specs.yml, then compare the custom-parameter handling with other optional list variables. Done means the list is accepted by the argument spec, the task is eligible when supplied, and the default no longer masks its optional nature.

Written by the indexing model from the issue text.

Assessment

Tech stack
ansible, elasticsearch
Domain
devops, search
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
84/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.