how to append to a list in jinja2 for ansible

Question:

Below is the jinja2 template that i wrote to use in ansible.

Below is the my desired output:

But when i am running the ansible playbook, it is throwing the error as below:

Any help would be appreciated..

Answer:

Try below code:

You ll get:

192.168.56.14:1234,192.168.56.13:1234,192.168.56.10:1234

Leave a Reply