Lets suppose that we have following definitions:
haproxy_backends:
refinery0:
ip: 192.168.33.11
refinery1:
ip: 192.168.33.12
Then the following map statement returns a list of ip values from the dictionary:
{{ haproxy_backends.values()|map(attribute='ip')|join(',') }} # 192.168.33.11,192,168,33.12