Why is it possible to do with an array though?
- hosts: all
connection: local
gather_facts: false
tasks:
- set_fact:
myvar: |
{% set comma = joiner(,) %}
[ {% for item in ['honey', 'bunch'] -%}
{{ comma() }}monkey
{%- endfor %}]
-
I realize this is an old thread, but why does this not work? It works as
expected for arrays...
For instance see this blog post:
http://adamj.eu/tech/2014/10/02/merging-groups-and-hostvars-in-ansible-variables/
That works just fine, but if you try to modify this to output an array of