Feature request: fetch

Hi

While I have some serious problems using the fetch module right now, I have a feature request for when I hopefully get it working on all files.

Right now the dest recreates the hierarchy of the src, which in my case will mean a deep nested labyrinth of directories wherein I need to dig out one file.

My wish:
I'd love to have the files I get end up in the directory where I run ansible, but with their hostnames appended, e.g. "logfile00.gz.webserver01" instead of "/a/b/c/d/e/logile00.gz".

How about that? Or, is there a nice work around?

/andreas

I think there would be too many permutations and the idea of the path to the file being important (imagine “error.log”) is important.

I don’t think I want to explain it working in two different modes in the docs.

If you are open to using the API and are not trying to integrate with playbooks, you may wish to look at the “slurp” module, which is basically an ansible-enabled data read, which is the backend
behind the “fetch” command.

You could basically write a helper script, similar to /usr/bin/ansible, but different, that fetched and saved like you wanted.

–Michael

>
> Hi
>
> While I have some serious problems using the fetch module right now, I have a feature request for when I hopefully get it working on all files.
>
> Right now the dest recreates the hierarchy of the src, which in my case will mean a deep nested labyrinth of directories wherein I need to dig out one file.
>
> My wish:
> I'd love to have the files I get end up in the directory where I run ansible, but with their hostnames appended, e.g. "logfile00.gz.webserver01" instead of "/a/b/c/d/e/logile00.gz".
>
> How about that? Or, is there a nice work around?

I think there would be too many permutations and the idea of the
path to the file being important (imagine "error.log") is important.

I don't think I want to explain it working in two different modes in
the docs.

I imagine it being quite simple to have one "prepend" setting which defaults to the path if not set to whatever given on the command line. I'm not wedded to the idea of using the hostname. Any given identifier would do.

But, since I understand little of the implications for implementing it, I will look into the path suggested below.

If you are open to using the API and are not trying to integrate
with playbooks, you may wish to look at the "slurp" module, which is
basically an ansible-enabled data read, which is the backend behind
the "fetch" command.

You could basically write a helper script, similar to
/usr/bin/ansible, but different, that fetched and saved like you
wanted.

I will probably be beyond me, but I'll have a look. Thanks for the pointer!

/andreas