Hi all,
thanks for all the hard work to make the new Ansible version possible.
I tested the new version with my current setup of playbooks and I got the
strange behavior that some file content I lookup with lookup('file', 'path')
and then copy it to a remote host did not got copied correctly with Ansible
1.8 anymore. The reason is the new fail_on_undefined argument (and its default
value of True) of the utils.listify_lookup_plugin_terms() function. Since path
is not a valid variable an exception is raised which is then silenced in
template.lookup() and then an empty file is copied to the remote host. This
happens even though 'path' is the (relative) path to an existing file.
In general I found it quite surprising that Ansible tries to template-expand
the string 'path' by feeding '{{path}}' into the template.template() function
(seemingly in both Ansible 1.7.2 and Ansible 1.8).
Moreover, the silencing of exceptions in template.lookup() took me quite some
time to find the source of the problems. The observed behavior was just that
empty files were transferred - no error was reported!
My example can be fixed to work for both versions for now by using
lookup('file', './path'). Somehow Jinja2 expands '{{./path}}' to './path'.
The following test example shows the behavior difference:
Assume we have a simple playbook like the following:
########## lookup.yml ##########