how to join inventory items in a comma delimited list?
1
vote
1
answer
2607
views
I have ansbile inv
# cat inv
[all]
vm1
vm2
I want to extract them in a comma delimited list using Jinja template
so I add jinja template
# cat comb_list.j2
{{ groups['all'] | map('extract', hostvars, ['item']) | join(',') }}"
but I guess item is not a hostvars, so throws error
I want end file to look like this
# cat comb_list
vm1,vm2
Asked by Sollosa
(1993 rep)
Sep 19, 2021, 02:09 PM
Last activity: Sep 19, 2021, 02:43 PM
Last activity: Sep 19, 2021, 02:43 PM