Questions tagged [packer]

PACKER QUESTIONS MUST BE PROGRAMMING RELATED. Packer is a tool for creating identical machine images for multiple platforms from a single source configuration.

"Packer is a modern tool that embraces best benefits. It's completely automated, simply run a packer build, no human touches it, Packer builds it for you. " - Mitchell Hashimoto (Creator)

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 machine images for multiple platforms in parallel. Packer does not replace configuration management like Chef or Puppet. In fact, when building images, Packer is able to use tools like Chef or Puppet to install software onto the image.

A machine image is a single static unit that contains a pre-configured operating system and installed software which is used to quickly create new running machines. Machine image formats change for each platform. Some examples include AMIs for EC2, VMDK/VMX files for VMware, OVF exports for VirtualBox, etc.

Resources

852 questions
3
votes
1 answer

FreeBSD pkg suddenly stopped bootstrapping

I've set up a packer template to generate vagrant base image of FreeBSD 10.3 and it was working well at least Mon Oct 3 00:34:41 2016 +0300. Yesterday I was going to continue my work on this project and it turned out this is not working anymore. So…
Eugene Petrov
  • 1,578
  • 1
  • 10
  • 22
3
votes
1 answer

AWS Unauthorized error for packer in gitlab ci

When my gitlab runner runs the following command: time packer build -var "git_branch=$CI_BUILD_REF_NAME" -var "git_hash=$CI_BUILD_REF" -color=false packer-application.json I get the following error: Build 'amazon-ebs' errored: Error creating…
Joaquim d'Souza
  • 1,416
  • 2
  • 14
  • 25
3
votes
3 answers

Packer and Ansible SSH/Sudo

I'm trying to setup packer and ansible-remote to create an AMI based on my pre-existing ansible scripts. I run into one of two issues. First I had a problem with SSH where I received SSH Error: data could not be sent to the remote host. Make sure…
tweeks200
  • 1,837
  • 5
  • 21
  • 33
3
votes
1 answer

Specify a VMWare fusion virtual network to connect to in packer

I'm now trying to use packer to build an VMware Fusion VM image, I can use packer to build the VM, however it relies on using the packer http kickstart server to present the kickstart file. The issue I have it that there is only one virtual network…
Jim
  • 155
  • 2
  • 7
3
votes
1 answer

Is it possible to trigger Packer's post-processor skipping the build step?

Let's asume I have a Packer file named windows_10.json. I ran packer build windows_10.json and it takes 3 to 4 hours to build a VirtualBox image of Windows 10. The build process finishes successfully and creates a VirtualBox image consisting of a…
Wlad
  • 2,866
  • 3
  • 28
  • 42
3
votes
2 answers

Run ansible-playbook with a user-data script on an EC2 instance

I am using Packer with Ansible to create an AWS EC2 image (AMI). Ansible is used to install Java 8, install the database (Cassandra), install Ansible and upload an Ansible playbook (I know that I should push the playbook to git and pull it but I…
Ivan Stoyanov
  • 5,412
  • 12
  • 55
  • 71
3
votes
1 answer

How to create an EC2 machine with Packer?

In AWS to make a new AMI, I usually run commands manually to verify that they're working, and then I image that box to create an AMI. But there are alternatives like packer.io, what's a minimal working example for using this service to make a simple…
M.R.
  • 1,053
  • 2
  • 13
  • 30
3
votes
4 answers

Using start process to install awscli msi package on remote windows machine

I am trying to use packer to provision awscli on a Windows machine. To install the awscli is use the following PowerShell script: $download_url = 'https://s3.amazonaws.com/aws-cli/AWSCLI64.msi' $downloaddestination = 'C:\Program…
krishna g
  • 461
  • 1
  • 5
  • 15
3
votes
2 answers

Hashicorp Packer won't execute packer-provisioner-shell on Windows host

This is my 1st question. I attempted to follow all of the guidelines. I am attempting to use Packer to create a Vagrant image of Debian 8. If I run a packer build with only the "builders" template it will execute successfully and a Virtualbox image…
3
votes
1 answer

Why won't shell-local download stage3?

I am working on a template located here. In the provision section I have: "provisioners": [ { "type": "shell-local", "command": "wget http://distfiles.gentoo.org/releases/amd64/autobuilds/{{user `stage3-date`}}/stage3-amd64-{{user…
John Mercier
  • 1,637
  • 3
  • 20
  • 44
3
votes
1 answer

Vagrantfile packaged in box (via packer) is not used

I used packer to create a vagrant box for a workshop I am running, and packaged vagrantfile in the box via the vagrantfile_template directive in the Vagrant post-processor as shown: ... "post-processors": [{ "type": "vagrant", …
frasertweedale
  • 5,424
  • 3
  • 26
  • 38
3
votes
1 answer

Why choose packer rather than native kickstart, WDS, or other tools?

What's the advantage to using packer rather than, say' Redhat's kickstarter or MS's WDS or other distros' more native tools? I know this must be an FAQ, but I have been unable to find it. And I know the answer must be obvious or I'm missing…
joe.smith
  • 31
  • 2
3
votes
0 answers

Can packer download and cache external files?

I have a packer project for gentoo which downloads the iso through packer and the stage3 file in a script. The iso is cached by packer and I would like to get the stage3 cached as well. This way the stage3 is not downloaded every time the box is…
John Mercier
  • 1,637
  • 3
  • 20
  • 44
3
votes
1 answer

Creating a custom Vagrantfile from Packer

I've been trying to figure out how to create a custom vagrant file from packer, I understand that in the post-processor section you will define a directory from which to scrap from, what I do not understand is if there needs to be a specifically…
ehime
  • 8,025
  • 14
  • 51
  • 110
3
votes
1 answer

Packer using default variables?

I've been trying to figure out the possibility of using option vars in packer, my script is as follows: "provisioners": [{ "type": "shell", "scripts": [ "scripts/centos/5.11/puppet-{{user `config`}}.sh", ] }], "variables": { "config":…
ehime
  • 8,025
  • 14
  • 51
  • 110