-
-
Notifications
You must be signed in to change notification settings - Fork 176
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
Cannot clean up unless 'creates' is specified. #328
Comments
As a workaround it is possible to specify the downloaded archive as the file used for the create parameter. |
That's a good workaround that I was not aware of. This does help me in one scenario that I have. However, consider the following scenario: I use the archive type to retrieve and extract an archive to install some software. The software is extracted to a temporary directory. Later an 'exec', or other provider, is run to install software from that temporary directory. I'd like to utilize the archive provider's 'creates' parameter to point to a file which WILL exist after this other provider runs but not immediately after the archive provider runs. In this way we can get idempotency out of the archive provider. Using the creates parameter in this way does, in fact work, but the down side is that the archive file does not get cleaned up. While this is probably an edge case I think being able to clean up the archive file without having a valid 'creates' file configured makes general sense. |
I agree with you, this is just a workaround if you really need this functionality now. |
I noticed today that, if a checksum is provided, and the downloaded archive file (stored in the C:\Windows\Temp folder) doesn't match that checksum, cleanup likewise fails to happen. This resulted in completely filling the O/S disk of several of our test VM's. Worse, since the tempfile name is randomly-generated, I can't simply follow up with a |
@ljkimmel -- Your second scenario may be alleviated by adding a custom extract command to the archive resource, instead of using a separate exec. |
That said, this bug has been open for over four years; it's high time to fix it. I will dig into the code and see what I can do... |
I have permission to spend some workhours to remediate the following:
Once I have code that works for my employer, I will try to extract a general solution and submit a PR back to the project. |
It appears that the archive file will not be cleaned up unless the 'creates' parameter is used AND the file that is specified by that parameter exists after extraction.
I think it would be useful to be able to cleanup even if this parameter is not specified or does not seem to exist. Is there reasoning behind not doing this?
The text was updated successfully, but these errors were encountered: