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.
Example: https://gist.github.com/ateoto/758b4a1f16793270e608 This works under Ansible 1.7.2 Should I file a issue on GH? Thanks, Matt On Wednesday, December 3, 2014 1:49:27 PM UTC-5, simonq wrote: > > So after putting some effort fixing the problem and doing some googling > which led me to this thread > <https://www.mail-archive.com/[email protected]/msg07926.html> > I > got it to work with the latest version. > > Solution: change* '{% raw %}{{ .Image }}{% endraw %}' *to *\{\{.Image\}\}* > > > I still would prefer using {% raw %} method since it looks nicer but at > least it's working now :) > > On Tuesday, 11 November 2014 22:58:23 UTC+1, simonq wrote: >> >> 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 }} >> > -- 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 post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/5d927b9c-8616-4cbc-b456-12be09f1b086%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
