User files supplied best practice

Hi all,

I am wondering if there is some clean way to handle files supplied by
the user.

I have two use cases:

- a role that ask for ssl certificates[1]. Currently I ask the user to
  add them in their root `files/` folder under specific names, and I use
  copy + `with_item`. It works pretty well. Is this the "good way" of
  doing it?

  [1] https://github.com/Mayeu/ansible-playbook-rabbitmq#using-it

- a role that wait for a list of file. Currently I ask the user to set
  a variable with the list of filenames, put the files in the root
  `files/` folder of their playbooks, and I use copy with `with_item`.

  I would like to make something like "copy *.rb". But `with_fileglob`
  only use the role `files` as root. And setting a relative path like
  `../../files/` to get to the user ones is not a clean solution to me.

What do you think about those two?

What are the rationnal to limit `with_fileglob` to the role `files/`
folder, and not making the same logic used by the copy module for
example (checking that the path exist either in the role, or the root
playbook)?

with_fileglob or with_first_found could be potentially very useful for generic things.

There’s also the synchronize module for copying lots of files, and the recursive=yes flag to the copy module.

Things like ‘copy’ know to look in the “files/” directory inside the role so there’s little need for relative paths.

“What are the rationnal to limit”

Lookup plugins just don’t look in multiple places for things like that, and in the case of file globbing, explicitness is good.

You could …/ here I’m pretty sure.

You could ../ here I'm pretty sure.

How will this work with Galaxy? Moduler are in `/etc/ansible/roles/`,
this will try to find something in `/etc`, or do ansible does some
magic about that?