mirror of
https://github.com/hashicorp/packer.git
synced 2026-09-21 15:31:41 -04:00
Previously, the Ansible provisioner would look for the username from the `USER` environment variable. Unfortunately, this is not always set - particularly in Docker containers. It's very confusing to understand why the error is happening. Switched to using Go's built-in `os/user` package for retrieving the current username. @rickard-von-essen had done this in7369841, but moved away from it ind59844fbecause, at the time, it wasn't possible to use that library with cross-compilation. This was fixed in Go in https://github.com/golang/go/commit/795e712b72802ad49b7c077964046f79c4f6586e