I just pushed a lot of commits I made on the plane last night that further upgrade the usage of the “new” 1.2 variable/conditional syntax, as detailed here:
Notice that with_items can now be fed the name of a variable, or even a Python expression, and it just works, no need for $foo or {{ }} at all. There are also various improvements to corner cases, so I’d consider this ready for full usage now.
There’s also a lot of other assorted cleanup.
My plan is to make the documentation for 1.2 all use the {{ new.way }}, and then determine if there is a future date where we may want to deprecate the $old.{way}
I think streamlining the docs will end a lot of user confusion.
Currently it internally flags deprecation warnings but doesn’t print them, I suspect we may choose to do the same with “when_” and only_if as well.
I also fixed some issues with parameterized playbook includes.
Yep, I had written a preprocessor for this yesterday but I think that’s a dangerous trap as someone will want to read the YAML later when it’s not valid.
As such, $cmd still work in this case, I don’t think I’m going to remove the basic variable referencing like this.
My other thought was to change the Jinja2 delimiter for playbooks so it’s different than what is used in templates, though that also has downsides.