Automating Image Creation with HashiCorp Packer for DevOps

Video description

HashiCorp Packer is an open-source tool for creating identical machine images for multiple platforms from a single source configuration. Packer is lightweight, runs on every major operating system, and is highly performant, creating parallel machine images for various platforms.

The course begins with a detailed introduction to HashiCorp Packer and the problems it solves. It illustrates use cases and examples. We will then explore writing Packer templates using HCL2 (the new standard for Packer 1.7+). You will learn about different builders, using variables, provisioners, post-processors, and code organization. We will integrate automation pipelines, secret management, and terraform. We will advance to integrate HashiCorp Packer with other automation tools, such as HashiCorp Terraform, HashiCorp Vault, and GitLab CI/CD. Using Packer, we will build images on multiple public cloud platforms and VMware images.

Upon completing the course, you can use HashiCorp Packer in your organization independently. You will use HCL2 to create your Packer templates and automate your machine images across multiple platforms—a critical skill to enabling automation in your environments.

What You Will Learn

  • Understand the core components and functions of HashiCorp Packer
  • Learn to automate the creation of machine images
  • Create real-world solutions with HashiCorp Packer using HCL2
  • Gain hands-on experience with Packer with demonstration labs
  • integrate Packer with Terraform, HashiCorp Vault, and GitLab CI/CD
  • Write Packer templates using HCL2 (the new standard for Packer 1.7+)

Audience

This course is designed for DevOps engineers looking to simplify the management of images in one or more platforms, automation engineers who want to create an image factory, engineers who want to easily manage one or many golden images for their workloads, and system administrators responsible for image and operating system maintenance and patching. The prerequisites include no Packer experience necessary and a basic understanding of one or more infrastructure platforms (AWS, Azure, VMware, OpenStack). Linux or Windows OS scripting is desirable but not required.

About The Author

Bryan Krausen: Bryan Krausen is an IT consultant with over 20 years of experience in enterprise IT. He specializes in Amazon Web Services and HashiCorp tools. Bryan focuses on cloud design and facilitates customer workshops that define business and technical requirements to allow businesses to deliver applications on the AWS cloud platform. He was the first individual to earn the HashiCorp Vault Expert partner certification.

Bryan has deployed and assisted with adopting the HashiCorp Vault into many Fortune 1000 companies. He delivers lectures at community events, such as HashiConf (2019 to 2022), HashiTalks (2019 to 2020), and many HashiCorp user groups across the mid-west and eastern US.

Table of contents

  1. Chapter 1 : Course Introduction
    1. Introduction
  2. Chapter 2 : Introduction to HashiCorp Packer
    1. Introduction to Packer - Section Overview
    2. Why Use Packer?
    3. Hello, Packer!
    4. Core Components of Packer
    5. Installing Packer
    6. Demo - Installing Packer
    7. The Packer Command Line
    8. Hands-On Lab - The Packer Command Line
    9. The Packer Workflow
    10. Demo - The Packer Workflow
    11. Introduction to Packer - Section Recap
    12. Installing Packer on Windows
    13. Installing Packer on Mac
  3. Chapter 3 : Writing Packer Templates
    1. Writing Packer Templates
    2. HCL Syntax
    3. Hands-On Lab - Converting JSON Templates to HCL
    4. Working with Packer's Core Components in HCL
    5. Hands-On Lab - Writing Packer Templates
  4. Chapter 4 : Builders
    1. Introduction to Builders
    2. Demo - Building AWS AMIs with Packer
    3. AWS Builders
    4. Demo - Building Azure Machine Images with Packer
    5. Demo - Building Google Compute Machine Images with Packer
    6. Demo - Building VMware Templates with Packer
    7. Hands-On Lab - Building Images in Multiple Regions
    8. Hands-On Lab - Building Images for Different Operating Systems
    9. Hands-On Lab - Building Images in Multiple Clouds
    10. Demo - Target Clouds and Build Types Using Packer
  5. Chapter 5 : Variables
    1. Introduction to Variables
    2. Declaring Packer Variables
    3. Using Variables in Packer Templates
    4. Using Environment Variables
    5. Hands-On Lab - Packer Variables
  6. Chapter 6 : Provisioners
    1. Introduction to Provisioners
    2. Examples of Different Provisioners
    3. Useful Features of Provisioners
    4. Hands-On Lab - Provisioners
  7. Chapter 7 : Post-Processors
    1. Introduction to Post-Processors
    2. Examples of Post-Processors
    3. Hands-On Lab - Post-Processors
  8. Chapter 8 : Code Organization
    1. Code Organization
    2. Hands-On Lab - Code Organization
    3. Hands-On Lab - Targeting Cloud Builds
    4. Hands-On Lab - Convert JSON to HCL
  9. Chapter 9 : Troubleshooting Your Packer Builds
    1. Hands-On Lab - Packer Debug
    2. Hands-On Lab - Packer Breakpoints
  10. Chapter 10 : Packer Integrations
    1. Hands-On Lab - Integrating Packer with Red Hat Ansible
    2. Hands-On Lab - Integrating Packer with HashiCorp Terraform
    3. Demo - Integrating Packer with HashiCorp Vault's KV v2 Secrets Engine
    4. Demo - Integrating Packer with HashiCorp Vault Using the AWS Secrets Engine
    5. Demo - Integrating Packer with GitLab CI/CD

Product information

  • Title: Automating Image Creation with HashiCorp Packer for DevOps
  • Author(s): Bryan Krausen
  • Release date: April 2023
  • Publisher(s): Packt Publishing
  • ISBN: 9781805128175