Open hamidnazari opened 9 years ago
Thanks for filing this bug report, I have run into this issue before, albeit very infrequently.
I will take a look and see if I can resolve it as per your suggestions.
I have now also ran into this issue. Do you have any plans to fix this in the immediate future? I get it every time I re-run puppet apply
.
I'm only proposing this fix I quickly put together as a solution to a problem I was facing. This is going to produce different behaviour as I have changed a default value. So, perhaps you would want to tweak it or rewrite it in a more backward-compatible way.
The Problem The first
puppet apply
worked just fine, but the second run would fail as it tried to uncompress a file that didn't exist anymore. The archive file gets removed at the end of the first run,file.pp:174 exec { "cleanup_${file}":
.Then the second run would not download the package because of
file.pp:133 unless => "test -d ${target}",
. Clearly the$target
now exists from the previous run. After this, the uncompression commands start failing.Easier Solution Make sure
untar
andunzip
resources also check for existence of$target
in their corresponding files.Better Solution Allow user to decide when the code should ignore the commands and when it should not. In my case, I needed the package redownloaded and reextracted.
Another Possible Nicety Perhaps we can introduce a
cache
orallow_redownload
parameter that check for or ignore existence of the archive file on the system.