- Lab
- A Cloud Guru
Adding Packer Plugins
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.
Path Info
Table of Contents
-
Challenge
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/
-
-
Challenge
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
-
-
Challenge
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*
-
What's a lab?
Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.
Provided environment for hands-on practice
We will provide the credentials and environment necessary for you to practice right within your browser.
Guided walkthrough
Follow along with the author’s guided walkthrough and build something new in your provided environment!
Did you know?
On average, you retain 75% more of your learning if you get time for practice.