-
Notifications
You must be signed in to change notification settings - Fork 23.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unarchive should support unpacking remote archives #6131
Comments
Thanks for filing a ticket! I am the friendly GitHub Ansibot. I see you did not fill out your issue description based on our new issue template. Please copy the contents of this template and paste it into the description of your ticket. Our system will automatically close tickets that do not have an issue template filled out within 7 days. Please note that due to large interest in Ansible, humans may not comment on your ticket if you ask them questions. Don't worry, you're still in the queue and the robots are looking after you. |
First request -- Please don't call contributors contributions ridiculous -- I'm very thankful for unarchive, and it's true it could do more. However, because a personal itch hasn't been scratched doesn't mean there isn't a lot of value in a new module, and I'm thankful for it. This feature idea is also slightly based on an assumption that the unarchive module must be handled in three step process. It's two. Download to the local host, push it to the remote. This requires an extra line or two,
Which is a little longer than normal, but it's not any more wasteful on bandwidth. It wastes an additional line in the playbook, but that's all. |
get_url does not download to the local host, it downloads to the remote host, nor do I want to download to the local host so your steps would not be functionally equivalent even if it did work that way. Which it doesn't. |
The get_url module will download to any host you run the play on, actually. You can do that in a local play, or use "delegate_to/local_action". The play is a better approach. |
I don't know what you're talking about but I thought I made it clear I don't want to download to the local host. The problem is that get_url works on the remote side and unarchive works on the local side. Therefore they cannot be used together directly. |
Not directly, but they can in fact be used in conjunction.
|
If you don't need to download to the control machine, this is just two tasks in the same play
There would be no fetch in either case. |
get_url will always download to the remote machine because it only takes remote paths. To be clear, you can name remote and local anything you like. Master/slave, control/minion. Whatever you call it, these two modules cannot operate on the same file back to back. Try testing your play. It doesn't make sense. Also, aren't you like the main guy behind Ansible? If so I should just retire to SaltStack. Hatch never behaves like this when people try to offer useful suggestions on his tracker. |
There's no argument going on here that I can tell, the ticket is still open and I'm trying to show you how to work around the problem without "fetch" above. It's evident I did make an error in my last post, switch "unarchive" to "shell: tar -xvf creates=some/path" and you'd have the same result. As I'm not liking where this thread is going we will be retiring this discussion however, please feel free to adopt another tool if you wish. |
Wow. |
Any chances to see this opened again? I think its quite confusing that unarchive does not work remotely... |
+1 to reopen this again. I also believe it is quite confusing that unarchive works only with local files. Also, I think it is not a good practice to encourage playbook devs to have the tar files within the local dir, because you usually have your playbooks tracked with a version system tool (such as git) and it is not nice to have big binary files within. |
I am also in favor of having another attribute like |
from unarchive's docs, just set copy=false Brian Coca |
@bcoca indeed this works fine for me.I guess I thought that either the archive is copied and then extracted or extracted over ssh onto the remote machine, depending on the setting. But it never occurred to me, that So basically the functionality is there and the issue is solved for me :-) |
It didn't occur to anyone else in this thread, either. The issue is not solved until the docs are rewritten to be clearer on this functionality. |
I tested it and it worked! :) |
I'm getting 404 on pull request attempts in github, but here is my proposed |
It's still unclear to me - sorry: I get this error: when I do this: I've also tried this with the same result: So - how can I extract a file on the target system without transfering it first ? Thanks clarification. |
you need BOTH src and dest, i imagine you wan the following: unarchive: copy=no src={{ item.key }} dest=/whererever/you/wantto/unarchive Brian Coca |
you're right. That was a little confusing.... Thank you. |
Thanks for clarifying and providing this example, very helpful. |
I tried to unarchive a zip, and assign the unziped file to user.
the assign of user did not work. can anyboy help ? |
If anyone wants to skip this thread... here's the cliff notes. OP asks To @mpdehaan and the community, thank you for saving me time. To OP, sorry your days suck so much... |
If I wish to download an archive on the remote host using get_url then the unarchive module is unable to help me extract it since unarchive only extracts local archives. In its current implementation, the only way to achieve this is:
This is incredibly wasteful and nigh on ridiculous. Unarchive should be able to extract remote archives.
The text was updated successfully, but these errors were encountered: