Open ciarancourtney opened 5 years ago
Hi, thanks for reaching out! As you've seen from the above output, this isn't really how we've used logs in the past, so I am wondering if there's some other feature that would solve your problem more cleanly. What specific information would be useful to you for the diffs you are trying to collect? It sounds to me like you want some kind of audit record for what scripts were run, etc. Is that accurate?
Really its the raw output of adhoc scripts, some of which spew verbose debug output for auditing/diffing later. So I'd like to use the overall build log as a log aggregater, so devs don't have to remember to explicitly setup logging for each script.
Capturing the kickstart/preseed output would be great as well, but I don't think this is something packer or even HVs like vbox can handle, in such cases the only option is to download local logs from VM at end.
Got it. I don't think this feature is something I'm going to be able to prioritize because it would likely represent a very large amount of tedious work for a reasonably small gain (I think most people end up using tools like inspec when they want to audit that builds ran successfully, rather than diffing run logs)
That said, it shouldn't be too hard to change your execute_command to pipe stdout and stderr to a file on your vm, then use the file provisioner to download stored stdout for future diffing.
Feature Description
When doing versioned, deterministic (as much as it is possible installing OSs) builds, its useful to store the build log output, but this output can contain lines that can change every time, creating noise that has to be ignored, incl:
Creating forwarded port mapping for communicator (SSH, WinRM, etc) (host port 2374)
Provisioning with shell script: /tmp/packer-shell466354443
file.tar 5.53 MiB / 13.14 MiB [==============
I guess it could be an opt in arg/var like like
--less-log-noise