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

--
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/0c42dbb2fbffd2b8e293c6e8051203cf%40olstad.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to