try:
- hosts: localhost
tags: s20
gather_facts: no
vars:
ip:
- 1.1.1.1
- 2.2.2.2
- 3.3.3.3
joined_ip: "'{{ \"', '\".join(ip)}}'"
tasks:
- debug: msg="(ip={{joined_ip}})"
PS: ansible supports a bit of python code execution within {{}}, which is what i'm misusing here.