It's much easier to put variables in host_vars/ or group_vars/ directories
instead, which is something I'd consider doing.

If you want to define structured variables, like you seem to be doing
above, you'll want this.

otherwise you're defining strings, which I don't think you want.




On Sat, Jun 21, 2014 at 8:54 PM, Harsh Jha <[email protected]> wrote:

> My host inventory has a host specific variable and it looks as follows -
>
>
>
>
>
>
>
>
>
>
> *[local]localhost[server_nodes]abcd.compute-1.amazonaws.com
> <http://abcd.compute-1.amazonaws.com>[client_nodes]xyz.compute-1.amazonaws.com
> <http://xyz.compute-1.amazonaws.com>
> subs="[\"elasticsearch_nodes\"]"ghi.compute-1.amazonaws.com
> <http://ghi.compute-1.amazonaws.com>
> subs="\[\"elasticsearch_nodes\"\]"jkl.compute-1.amazonaws.com
> <http://jkl.compute-1.amazonaws.com> subs='["nginx_nodes"]'*
>
> I'm talking about the "subs" variable here. I have tried using it in three
> different ways as shown above but none of them solves my purpose. Actually
> I want to keep double quotes. So if I put the following in a template file -
>
> var1 = {{ subs }}
>
> It should get converted to -
>
> var1 = ["nginx_nodes"]
>
> instead it gets converted to -
>
> var1 = ['nginx_nodes']
>
> I want to keep double quotes and avoid getting them converted to single
> quotes. Please provide some suggestions. 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 [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/5f053918-8a78-49e0-951c-8f329f13fec8%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/5f053918-8a78-49e0-951c-8f329f13fec8%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> 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 [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/CA%2BnsWgxdiQXcw%2B4F%3D5HzpMfxbEz83YD89JzJydRBtG7FsPFc4w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to