capable.core219.evaluate
Evaluate Ansible conditional expressions.
Requires ansible-core >=2.19.1; version 2.19.0 can expose runtime conditional values despite task no_log.
Evaluates trusted expressions with the native core conditional evaluator, like when.
Expressions must be strings defined in trusted YAML variables, not inline Jinja string literals or external data.
Lists supplied at any positional argument are expanded once; nested lists are rejected.
All reached terms must pass; false short-circuits subsequent terms. Booleans pass through unchanged.
No positional terms is an error; an explicit empty list returns true; empty strings are errors.
Expressions must not contain template delimiters. Native core conditional configuration applies.
Uses Ansible task variables, not Jinja set or for-loop locals. See the capable.core219.evaluate filter.
This never-shipped feature moved from capable.core212.evaluate to capable.core219.evaluate.
Parameters
Section titled “Parameters”_terms (required)
Section titled “_terms (required)”Type: raw · Required: yes
One or more trusted YAML conditional expressions, booleans, or lists of these.
Supports the same syntax as when and failed_when.
Examples
Section titled “Examples”- name: Evaluate a single conditional expression vars: ready: true ready_condition: ready is defined and ready is_ready: "{{ lookup('capable.core219.evaluate', ready_condition) }}" ansible.builtin.assert: that: - is_ready is sameas true
- name: Evaluate multiple conditional expressions (all must pass) vars: foo: 1 bar: 2 conditions: - foo == 1 - bar == 2 is_configured: "{{ lookup('capable.core219.evaluate', conditions) }}" ansible.builtin.assert: that: - is_configured is sameas trueReturn Values
Section titled “Return Values”Type: list
One boolean AND result. lookup unwraps it; query or wantlist=True returns the list.
Authors
Section titled “Authors”- Kirill Satarin (@kksat)