On 06.12.2018 08:12, Nicolas G wrote:
> I have some files under my role path dir :
>
> ls roles/my-role/files/
> file1 file2 file3
>
> I can display the content of the file by running :
> - name: display contents
>
> debug:
> msg: "{{ item }}"
> with_file:
> - "roles/my-role/files/file1"
>
>
> if in the last line I try something like :
> with_file:
> - "roles/my-role/files/*"
>
You need to use the fileglob, so something like this
- debug: msg="{{ lookup('file', item) }}"
with_fileglob: roles/my-role/files/*
--
Kai Stian Olstad