HashiCorp Packer allows users to create identical, cross-platform machine images by writing templates that leverage our existing infrastructure tools; however, Packer doesn’t always offers native support for everything we require. In this hands-on lab, we’ll prepare our desired Packer setup by installing some Packer plugins.
Learning Objectives
Successfully complete this lab by achieving the following learning objectives:
- Add the Windows Update Plugin
Locate the appropriate binary from the plugin repository and download it:
wget https://github.com/rgl/packer-provisioner-windows-update/releases/download/v0.9.0/packer-provisioner-windows-update-linux.tgz
Expand the file:
tar zxvf packer-provisioner-windows-update-linux.tgz
Make binary executable:
chmod +x packer-provisioner-windows-update
Create the necessary
plugins
directory:mkdir -p ~/.packer.d/plugins
Move the binary:
mv packer-provisioner-windows-update ~/.packer.d/plugins/
- Add ARM Builder Dependencies
The ARM Builder plugin is a Go module; install a version of Go newer than 1.11.0:
wget https://go.dev/dl/go1.18.3.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf go1.18.3.linux-amd64.tar.gz
export PATH=$PATH:/usr/local/go/bin
Install the other module dependencies:
sudo apt install kpartx qemu-user-static
- Add the ARM Builder Plugin
Pull down the repository:
git clone https://github.com/solo-io/packer-builder-arm-image.git
cd packer-builder-arm-image
Build the module:
go mod download
go build
Move the resulting binary:
mv packer-plugin-arm-image ~/.packer.d/plugins/
Clean up your home directory when finished:
cd
rm -rf packer*
sudo rm -rf go*