Skip to content

frank03k/vagrant_packer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Packer - Demo project for learning

Status Packer Version Ansible Version

Tested the packer configuration on MacOS - vbox-ubuntu20.pkr.hcl. And run a vagrant vm for a testing on CentOS 8 within KVM (Qemu) provider.

In this repository i don't handle with preseed, subiquity or kickstart configuration. There are simple demo-configuration for the packer build.


Prerequisites

Following setup will be needed for this example repo:

Deployment

MacOS + Virtualbox

If you already a setup on MacOS with Virtualbox, you can use direct packer without a vagrant vm.

  1. Change in packer directory
cd packer
  1. Run the Deployment with following Arguments
make FILE="vbox-ubuntu20.pkr.hcl" VARS="variables.pkrvars.hcl"
  1. After the build is finished, you can use the image for further deployments or use cases.

Vagrant VM

If you don't have a setup on you client, then we use a vagrant vm.

💡 Attention:

We need ansible for provisioning, so make sure you can use ansible with plain or with a virtualenv.


  1. Start the vagrant vm
vagrant up
  1. SSH-Connection
vagrant ssh
  1. The vagrant vm has our packer directory mounted to /data, so we change to this directory and can run the packer build process.
cd /data
make FILE="ubuntu-20.pkr.hcl" VARS="variables.pkrvars.hcl"
  1. After the build is finished, you can the image for further deployments or use cases.

About

Try hashicorp packer in an vagrant vm

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published