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'] | bool → False. 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:
The "Set jvm custom options" task in
roles/elasticsearch/tasks/main.ymlis gated bywhen: elasticsearch_jvm_custom_parameters | bool, but the variable is meant to be alist of JVM option lines (the template does
{% for item in elasticsearch_jvm_custom_parameters %}).A list is not a recognized boolean, so
| boolreturnsFalsefor any list — verified:['-Xss1m'] | bool→False. The task is therefore never executed and custom JVMoptions are silently ignored. No value both passes
| booland is iterable, so thevariable is effectively dead.
Fix:
elasticsearch_jvm_custom_parametersfromdefaults/main.yml— an optional listneeds no default.
meta/argument_specs.yml:type: list,elements: str, no default.when: elasticsearch_jvm_custom_parameters is defined(consistent with the other optional list variables).
To Reproduce
No response
Your Environment