-
Book Overview & Buying
-
Table Of Contents
HashiCorp Packer in Production
By :
Each source declaration has support for a communicator option. The communicator configured with the builder tells Packer how to communicate with the temporary build environment for applying provisioners. The most common communicator is SSH, while Windows VMs typically use WinRM. Docker is an exception as Packer can connect directly to the container terminal to perform tasks without a running SSH server. A communicator usually needs credentials configured to connect, such as user and password, keys, or certificate. Take this example from our virtualbox-iso source:
communicator = "ssh" ssh_username = "root" ssh_password = "packer"
You can see that we’re specifying the communicator type and the necessary credentials inline. Obviously, it’s a terrible idea to have plaintext SSH credentials in a Packer template. There are a few options around this.
First of all, remember we can include credentials as variables...