I would like to write a loop for this Use Case:
I have an Ansible templates
directory and inside this directory files with extension .j2
, for example I have like this files.
data-service01.service.j2
data-relation.service.j2
data-query.service.j2
data-analysis.service.j2
So I want to write a task in Ansible to loop in templates
directory to transfer files inside the templates
to the destination by writing src: data-*
it can loop to all files start with data-
to transfer to directory.
Can I do this because I using the normal way
src: data-service01.service.j2
dest: data-service01.service
But I want to looping inside templates
directory by
src: data-*.j2
How I can do this with loop
?