Alternatively, you could also do:

\{\{.Id\}\}

Or

{% raw %}{{ .Id }}{% endraw %}

I probably prefer the raw/endraw most of the time.




On Fri, Aug 8, 2014 at 5:35 PM, Michael Peters <michael00pet...@gmail.com>
wrote:

> Probably not the best way, but you could use a string inside of the
> jinja templating
>
>     - name: obtain image id
>       local_action: shell docker inspect --format={{ '{{.Id}}' }} {{
> docker_image_name }} | cut
>       register: docker_image_id
>
>
> On Fri, Aug 8, 2014 at 1:04 PM, Vijay Korapaty <ansiblel...@korapaty.com>
> wrote:
> > I'm trying to execute the following task:
> >
> >     - name: obtain image id
> >
> >       local_action: shell docker inspect --format={{.Id}} {{
> > docker_image_name }} | cut
> >
> >       register: docker_image_id
> >
> >
> > where '{{.Id}}' should not be considered as a variable. I've tried
> escaping
> > it in this fashion: {{ '{{' }} .Id {{ '}}' }} as described by the Jinja2
> > docs, but that results in it appearing as '{# .Id #}'. I'm assuming that
> > it's still being considered as a variable.
> >
> > Is there a way to force double curly brackets to not be considered as a
> > variable?
> >
> > Thanks.
> >
> > --
> > 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 ansible-project+unsubscr...@googlegroups.com.
> > To post to this group, send email to ansible-project@googlegroups.com.
> > To view this discussion on the web visit
> >
> https://groups.google.com/d/msgid/ansible-project/53E50320.3090603%40korapaty.com
> .
> > For more options, visit https://groups.google.com/d/optout.
>
> --
> 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 ansible-project+unsubscr...@googlegroups.com.
> To post to this group, send email to ansible-project@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/CAJQqANft6beoWMkgr_9fy8nwdriFpRq_30tvDkM%3DOJxneEVWyg%40mail.gmail.com
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgwYiKqYu0CepN70vQuCGoVY9nBQ3HcXxxobSJ_ienhUgw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to