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.




On Fri, Jan 10, 2014 at 4:52 AM, Mayeu <[email protected]> wrote:

> 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)?
>
> --
> Mayeu a.k.a Matthieu
> http://6x9.fr
>



-- 
Michael DeHaan <[email protected]>
CTO, AnsibleWorks, Inc.
http://www.ansibleworks.com/

-- 
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].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to