Hey,
I am looking to concatenate variables in an array from a with_fileglob but
i am not sure that set_fact works with loops
- hosts : all
vars:
myfiles : ["old"]
tasks:
- name: "facts"
set_fact:
myfiles: "{{ [item] | union(myfiles) }}"
with_items:
- "new1"
- "new2"
- "new3"
- name: "Debug"
debug:
var=myfiles
The output
"myfiles": [
"new3",
"old"
]
Only the last item is added. any ideas ?
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/93fbd2d2-3169-4a7c-aed0-9c36e7ccc4ab%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.