From the course: Learning HashiCorp Packer

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

Debugging

Debugging - Packer Tutorial

From the course: Learning HashiCorp Packer

Start my 1-month free trial

Debugging

- [Instructor] Sometimes it can be very difficult to see what's happening when Packer is building an image. The build command takes in a debug flag, which pauses after every single step, so you can take a look at what's happening. We'll use that now. So you type packer build - debug, and then our template name, which is ubuntu json in this case And it's already stopped, and seeing if we're happy with the AMI Name that we're gonna do and if we press enter, it tells us what image it found. We can just basically verify every single step that takes place with this flag. So I'm gonna stop that build. If we want more debug information, Packer provides an environment variable which is PACKER_LOG. And if that sets anything other than an empty string, then it will write the standard error, a lot of information. And as it is so much information, I do suggest piping it to a file for reading later. Let's have a look at this. In the next, we can pre-pen the command with the environment variable…

Contents