I get template error while templating string: unexpected ‘.’ when running this task using ansible 1.8 (devel fa953e162e). Used to work with previous version I was running (1d04e4b3d2). Any thoughts?
name: Get image id
command: >
docker inspect -f ‘{% raw %}{{ .Image }}{% endraw %}’ nginx
register: container_image
name: Do something with image
command: echo {{ container_image.stdout }}
Sounds like there’s a bug that should be filed - Can you please share the full ansible-playbook output from the above so we can see it in context though?
I’m having the same issue. Also with a docker inspect command. It’s worth noting that the command with the raw tags executes correctly, and it’s only when acting upon the stdout that the TemplateSyntaxError is raised.
I just had the same issue and solved it redirecting docker inspect output to a local file and cat’ing it from there. Is there a general fix for this meanwhile? Really looks like something is hanging around after docker inspect execution.