Skip to content

HashiCorp Packer code to build portable virtual machines in AWS AMIs, EC2 / EKS, AmazonLinux, OVA format for Ubuntu, Debian and Redhat based systems with automated installers Kickstart, Preseed and AutoInstaller / Cloud-Init. Useful for Cloud or Virtualized environments, Kubernetes base systems and VM appliances to ship to customers

License

Notifications You must be signed in to change notification settings

HariSekhon/Packer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Repository files navigation

Hari Sekhon - HashiCorp Packer templates

GitHub starsGitHub forksLineCountCocomoLicenseMy LinkedInGitHub Last Commit

CodacyCodeFactorQuality Gate StatusMaintainability RatingReliability RatingSecurity Rating

HCLLinuxMac

Mac HomebrewCentOSDebianFedoraRedhatRockyUbuntu

Repo on GitHubRepo on GitLabRepo on Azure DevOpsRepo on BitBucket

CI Builds OverviewMarkdownValidationKicsGrypeSemgrepSemgrep CloudTrivy

HashiCorp Packer HCLRedhat KickstartDebian PreseedUbuntu AutoInstall Cloud-Init

Packer templates for building AWS AMI and portable OVA virtual machines images.

Useful for AWS EC2 & EKS, IoT edge sites, Kubernetes base servers etc.

Bare metal servers can be installed using each Linux distro's native automated installers.

Virtual Machines as appliances in portable OVA format are 100% automated using the installers above.

AWS Custom AMI use cases include adding tooling, or security agents to EKS cluster nodes for Corporate Compliance.

The primary templates are for the main Linux distributions:

  • Amazon Linux - based off existing AMI
  • Ubuntu - using Ubuntu AutoInstaller
  • Debian - using Debian Preseeding
  • Redhat - using Redhat Kickstart
    • Redhat Enterprise Linux (RHEL)
    • CentOS (end-of-life)
    • Rocky Linux (CentOS replacement)
    • Fedora

VM OVA appliances can be created in any number of different virtualization systems supported by Packer.

You must install your virtualization system before running Packer.

The following builds are provided for these combinations of Linux distros, arches and virtualization systems:

Quick Start

Running make <distro> will build the portable virtual machine OVA for that Linux distribution 100% automated using that distro's native installer's automation method:

make debian

results in:

output-debian/debian-12.ova output-debian/debian-12.md5 output-debian/debian-12.sha512 

You can then just import the debian.ova file on any virtualization platform such as VMware vSphere or your local VirtualBox.

Easy Customization

Tweak the corresponding text files for that distro eg.

*.pkr.hcl installers/* scripts/* 

and then re-run

make <distro>

or for a specific build:

make <distro>-<major_version>

For more details, tips and tricks including how to debug Packer builds, read the Knowledge-Base - Packer page.

Packer Template

A heavily documented generic Packer template can be found in the HariSekhon/Templates repo:

https://github.com/HariSekhon/Templates/blob/master/template.pkr.hcl

HariSekhon/Templates - template.pkrvars.hcl

Readme Card

Star History

Star History Chart

More Core Repos

Knowledge

Readme CardReadme Card

DevOps Code

Readme CardReadme CardReadme CardReadme Card

Containerization

Readme CardReadme Card

CI/CD

Readme CardReadme Card

Databases - DBA - SQL

Readme Card

DevOps Reloaded

Readme CardReadme CardReadme CardReadme CardReadme Card

Monitoring

Readme CardReadme CardReadme Card

Templates

Readme CardReadme Card

Desktop

Readme CardReadme Card

Spotify

Readme CardReadme Card

The rest of my original source repos are here.

Pre-built Docker images are available on my DockerHub.

About

HashiCorp Packer code to build portable virtual machines in AWS AMIs, EC2 / EKS, AmazonLinux, OVA format for Ubuntu, Debian and Redhat based systems with automated installers Kickstart, Preseed and AutoInstaller / Cloud-Init. Useful for Cloud or Virtualized environments, Kubernetes base systems and VM appliances to ship to customers

Topics

Resources

License

Stars

Watchers

Forks