The behavior of ~ in ansible "when" statements is puzzling. For example, if LIB is a fact, set by set_fact, with a value of "lib64" I would expect the following statement to be true if /usr/lib64/cernlib/2006 exists, and false otherwise:
when: '"/usr/" ~ LIB ~ "/cernlib/2006" is exists'
What I find, though, is that the conditional is always true.
The conditional behaves as expected if I omit reference to LIB and just write:
when: '"/usr/lib64/cernlib/2006" is exists'
I can easily imagine a typo that would cause "when" to give me a "false" result, but I'm puzzled by the fact that this always gives me "true".
Am I just doing something wrong?