---
title: "Packer: Infrastructure Image Building Fundamentals"
description: "Master automated machine image creation with this quiz on Packer builders, provisioners, and HCL templates."
author: "Mohammad Abu Mattar"
canonical: https://mkabumattar.com/quizzes/post/packer-image-building-fundamentals-quiz
---

# Packer: Infrastructure Image Building Fundamentals

Welcome to the Packer Basics Quiz! Packer creates consistent, automated machine images across any platform. This quiz will test your knowledge of how builders, provisioners, and post-processors work together in a "Build Once, Run Anywhere" workflow. Good luck!

## Questions

### 1. What is the primary purpose of HashiCorp Packer?

- To manage active virtual machines in a production cluster
- To create identical machine images for multiple platforms
- To provide a registry for storing and versioning containers
- To aggregate and monitor real-time server health metrics

**Hint:** Think about machine images.

### 2. What is a Packer "Builder"?

- A developer role responsible for writing HCL templates
- A component that creates an image for a specific platform
- A specialized compiler used for local source code binaries
- A script used to install packages on the guest machine

**Hint:** Platform-specific component.

### 3. What is a Packer "Provisioner"?

- A cloud billing service used to rent hardware resources
- A component used to configure software on a machine image
- A post-build utility used to delete old image versions
- A backup routine used to capture existing database state

**Hint:** Configuring the machine.

### 4. Which command is used to verify the syntax of a Packer template?

- `packer verify` code syntax
- `packer validate` template
- `packer check` configuration
- `packer inspect` variables

**Hint:** Syntax checking.

### 5. What is a "Post-Processor" used for?

- To install the base operating system on the target VM
- To perform tasks on the resulting artifact after a build
- To define the initial source configuration for a builder
- To manage local environment variables on the host machine

**Hint:** Happens after the image is created.

### 6. What is "Immutable Infrastructure"?

- Infrastructure that never requires updates or patching
- Replacing servers with new images for every configuration
- Infrastructure that is physically secured in a data center
- A storage method for preventing data deletion over time

**Hint:** Don't change it, replace it.

### 7. What is the default configuration language for modern Packer templates?

- JSON (JavaScript Object Notation)
- HCL (HashiCorp Configuration Language)
- YAML (YAML Ain't Markup Language)
- XML (Extensible Markup Language)

**Hint:** The same as Terraform.

### 8. What does the `packer build` command do?

- Validates code for syntax and structural errors only
- Executes builders and provisioners to create artifacts
- Permanently deletes all historical image versions
- Downloads and updates the local Packer binary version

**Hint:** The main action.

### 9. What is a "Source" block in an HCL Packer template?

- The directory path for the application source code
- A block defining the base image and machine parameters
- A list of authorized developers for the build process
- A configuration for an external SQL database instance

**Hint:** Defining the base image.

### 10. How do you pass variables into a Packer build from the command line?

- `packer build --variable name=value template.pkr.hcl`
- `packer build -var "name=value" template.pkr.hcl`
- `packer build set name=value template.pkr.hcl`
- `packer build --env name=value template.pkr.hcl`

**Hint:** The -var flag.

### 11. What is the purpose of the "shell" provisioner?

- To configure a network firewall for the guest machine
- To run terminal commands on the guest machine during build
- To customize the desktop environment on the host machine
- To monitor the local file system for code changes

**Hint:** Running scripts.

### 12. What is a "Manifest" post-processor?

- A document containing physical shipping labels for servers
- A tool that outputs a JSON file with build artifact details
- A command used to shut down the temporary build instance
- A report detailing the security compliance of the image

**Hint:** Record-keeping.

### 13. What does "Parallel Builds" mean in Packer?

- Executing multiple provisioners on a single machine image
- Running multiple builders simultaneously for different clouds
- Building an application and its database in the same image
- Distributing image data across multiple network cables

**Hint:** Multi-cloud efficiency.

### 14. What is the "file" provisioner used for?

- To delete specific configuration files from the image
- To upload files from the host to the machine being built
- To search for specific file extensions on the internet
- To encrypt the filesystem of the target virtual machine

**Hint:** Moving data.

### 15. What happens to the temporary VM Packer creates after a successful build?

- It remains active in your account for manual inspection
- It is automatically terminated and deleted by Packer
- It is converted into a managed database instance
- It is archived in a restricted storage folder for audit

**Hint:** Cleanup.

### 16. What is a "Communicator" in Packer?

- A human mediator who facilitates team sprint meetings
- The interface used to connect to the machine being built
- A specialized tool used for sending automated build emails
- A hardware device used to connect servers to a network

**Hint:** SSH or WinRM.

### 17. What is the purpose of "Packer Init"?

- To start the Packer background daemon for the first time
- To download required plugins defined in the HCL template
- To delete all cached image artifacts from the local drive
- To set the administrative password for the Packer user

**Hint:** Plugin management.

### 18. Which provisioner would you use to run an Ansible playbook against the image?

- The `ansible` or `ansible-local` provisioners
- The `shell` provisioner running manual ansible commands
- The `packer-ansible` specialized external binary
- The `config-ansible` system environment variable

**Hint:** Ansible integration.

### 19. What is a "User Variable" in Packer?

- A variable that stores the full name of the developer
- A custom variable used to make templates dynamic
- A secret variable that stores the root system password
- A list containing all user accounts on the target server

**Hint:** Template customization.

### 20. What does the `-force` flag do in a packer build?

- It increases the priority of the build process in the OS
- It deletes an existing image with the same name before building
- It forces the target virtual machine to perform a hard reboot
- It bypasses all syntax validation and security checks

**Hint:** Overwriting existing images.

### 21. What is the "Amazon-EBS" builder used for?

- To create a backup snapshot of an existing EBS volume
- To build an AMI by launching and stopping an EC2 instance
- To manufacture a physical hard drive for a data center
- To manage and audit global AWS billing accounts

**Hint:** AWS images.

### 22. What is "Packer fmt"?

- A command to format the hard drive of the host machine
- A command to format HCL code to HashiCorp standards
- A library containing all supported system font styles
- A utility for deleting all existing template code

**Hint:** Canonical formatting.

### 23. What is a "Variables File" (.pkrvars.hcl)?

- A system log file that stores previous build errors
- An external file that defines values for template variables
- A list of all developers with access to the build system
- A tool used for writing and executing application code

**Hint:** Externalizing values.

### 24. What is the "null" builder used for?

- To create an image that contains zero files or data
- To test provisioners without creating an actual cloud image
- To delete the current project from the local disk
- A directory containing a list of all system users

**Hint:** Testing provisioners only.

### 25. What is "Artifact" in Packer terms?

- An ancient or deprecated block of configuration code
- The result of a builder, such as an AMI or a file
- A tool used for writing and debugging shell scripts
- A security compliance report for the target image

**Hint:** The output.

### 26. What are "Only" and "Except" in a Packer build block?

- Methods for selecting the highest priority developers
- Directives to run components only for specific builders
- Commands used to delete a specific cloud cluster
- Tools used for writing and linting HCL template code

**Hint:** Selective builder execution.

### 27. What is "Sensitive Variables" in Packer?

- Variables that cause the build to fail on any error
- Variables that are masked in the UI and build logs
- A method for deleting source code after a successful build
- A list containing all user accounts on the local system

**Hint:** Hiding secrets in logs.

### 28. What is the "Local" Shell provisioner?

- A way to communicate with other servers on the LAN
- A provisioner that runs commands on the host machine
- A tool used for writing and compiling application code
- A firewall used to protect the local cloud network

**Hint:** Running scripts on YOUR computer.

### 29. What is "Packer Console"?

- A physical hardware controller for data center racks
- An interactive shell to test HCL expressions
- A command used to delete an entire cloud project
- A specialized tool used for writing HCL template code

**Hint:** Testing HCL expressions.

### 30. Why use Packer with Terraform?

- To increase the execution speed of Terraform directly
- To build the images that Terraform later deploys
- To delete the cloud account and all associated resources
- A directory containing all authorized system users

**Hint:** Bake then deploy.
