Add quotes to elemens of the list in jinja2 (ansible)


I have very simple line in the template:

And I have list for ip:

But application wants IPs with quotes (ip=’′, ‘’).

I can do it like this:

But it is very ugly. Is any nice way to add quotes on each element of the list in ansible?



Actually there is a very simple method to achieve this:

The filter map iterates over every item and let quote process it. Afterwards you can easily join them together.

Leave a Reply