- debug:
msg: Hi
when:
- entrycurrdb.stdout.find(hostvars['localhost']['BASEPATH_FINAL'] ~ '/' ~
vars[(item | splitext)[1].split('.')[1] | default('exe')] ~ '/' ~ item |
basename) == -1
- actualfile.stat.exists | bool
A few comments though
- This is an extremely complex and weird conditional that will be hard
for anything to read and understand what is happening. Consider simplifying
it as much as you can or using set_fact beforehand to build the path to
find components so you can better document it.
- Split every and condition only a new entry to reduce the line length,
each entry is just and'd together
- The '~' is a jinja2 string concatenation operator that works similar
to '+' but it converts both sides to a string before adding it together
making it better for what you want
- The reason why the warning still showed is because you still have
jinja2 blocks, technically they are required in your example because you
have it in a string but what you should be doing is not enclse the var in a
string and concat it together
I haven't tested this but it "should" work.
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/f1aae5f8-b18e-4f6b-b770-b3a741d8cb8d%40googlegroups.com.