Skip to content

Commit

Permalink
test: do not use true test with select
Browse files Browse the repository at this point in the history
Do not use `select("true")`.  This causes an error with Ansible 2.9
with Jinja 2.7 because there is no `true` test.  Instead, just rely
on the default behavior of `select` to evaluate the argument in a
boolean context.

https://jinja.palletsprojects.com/en/2.9.x/templates/#select
`If no test is specified, each object will be evaluated as a boolean.`

Signed-off-by: Rich Megginson <[email protected]>
  • Loading branch information
richm committed Nov 20, 2023
1 parent 63fc523 commit 3242b07
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tasks/shell_pcs/check-and-prepare-role-variables.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
[item.target is defined,
item.target_pattern is defined,
item.target_attribute is defined]
| select("true") | list | length != 1
| select | list | length != 1
loop: "{{ ha_cluster_stonith_levels }}"
run_once: true

Expand Down

0 comments on commit 3242b07

Please sign in to comment.