Retaining double-quotes in resulting file created from template

11 views
Skip to first unread message

ZillaYT

unread,
Nov 2, 2016, 4:04:43 PM11/2/16
to Ansible Project
I have a template that does has this line

host_ip = "http://{{ ansible_default_ipv4.address }}"

which results into a line in the dest file that has, for example

host_ip = http://10.10.10.10

However, how do modify the template so I retain the "" in the resulting file, so it looks like this

host_ip = "http://10.10.10.10"




Uwe Sauter

unread,
Nov 2, 2016, 4:10:57 PM11/2/16
to ansible...@googlegroups.com
Putting single quotes around should solve this.

host_ip = '"http://{{ ansible_default_ipv4.address }}"'

Regards,

Uwe


Am 02.11.2016 um 21:04 schrieb ZillaYT:
> I have a template that does has this line
>
> |
> host_ip ="http://{{ ansible_default_ipv4.address }}"
> |
>
> which results into a line in the dest file that has, for example
>
> |
> host_ip =http://10.10.10.10
>
> |
> However, how do modify the template so I retain the "" in the resulting file, so it looks like this
>
> |
> host_ip ="http://10.10.10.10"
> |
>
>
>
>
> --
> 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-proje...@googlegroups.com <mailto:ansible-proje...@googlegroups.com>.
> To post to this group, send email to ansible...@googlegroups.com <mailto:ansible...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/e99098ad-d56c-42ef-8e5e-771650b94358%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/e99098ad-d56c-42ef-8e5e-771650b94358%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages