unnecessary to use '{{' in conditionals...except when it isn't

[WARNING]: It is unnecessary to use ‘{{’ in conditionals, leave variables in loop expressions bare.

I’m using with_items for conditions in the fail module and it seems that I can’t use bare expressions. I have a playbook that with actions that can only run if a number of pre-conditions have been met. Instead of defining N tasks to grep in a file I’m stashing the contents of the file and using multiple search conditions.

Is there a different/better way to do this type of testing?
Is there some way to do this without dereferenceing

item.test is not a bare variable, in any case the warning has been
removed in newer versions of ansible.

The brackets are, in fact, necessary. The effect your see is a known problem with a feature called “bare variable detection” - it never worked well, and probably never will (it’s a problem since at least 1.6).

Shawn Ferry sferry@gmail.com napisał: