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

Set mirrors in /etc/apt/sources.list with Preseed

I'd like to automate the creation of my Debian images. Using Packer 0.7.1 and Preseed this has worked pretty well so far, the only thing I can't get right is the content of /etc/apt/sources.list. I want it to be like this: deb…
Matthias Braun
  • 32,039
  • 22
  • 142
  • 171
3
votes
1 answer

Packer: Using npm install in packer script - fails with command not found error

I've been playing with packer lately and found it an amazing tool. But I'm failing to use installed tools in the installation script. Here's an example packer template I've been playing with (I've know there are better ways to use this with scripts…
alonisser
  • 11,542
  • 21
  • 85
  • 139
3
votes
1 answer

Packer EC2_HOME: Neither of EC2_AMITOOL_HOME or EC2_HOME environment variables are set

I use packer to build Amazon AMI and I ran into the issue that: The base AMI (ami-a4bdd194) does not have ec2-ami-tools install so I wrote a small script to install it using provisions attribute. It installed successfully to /usr/local/bin but I…
Nam Nguyen
  • 5,668
  • 14
  • 56
  • 70
3
votes
2 answers

Packer: Generate AMI from a running EC2 Instance

I woud like to create an AMI (Amazon Machine Image) from a running EC2 instance using Packers.. Here is my usecase: 1) Use packer to generate the base AMI and start the EC2 instance 2) Have user data configuration on the EC2 instance.. (Human…
user3006942
  • 155
  • 2
  • 12
2
votes
1 answer

Installing PAR::Packer on Windows, dmake error 255

I am trying to create a binary of a perl script for Windows, and I cannot afford commercial applications such as perl2exe and Active Perl Dev Kit (I am aware there are trial versions). Because of this I have installed strawberry perl on a Windows…
bag-man
  • 1,423
  • 2
  • 19
  • 23
2
votes
1 answer

Which lines need semicolons for Dean Edwards Javascript packer?

So his help site states that "All statements, including function declarations, must be correctly terminated with semi-colons." But in this sample code, he specifically say not to end the if statement in semicolon. So is there a complete list of what…
hobbes3
  • 28,078
  • 24
  • 87
  • 116
2
votes
1 answer

Packer builder source_ami_filter for ubuntu 22.04

I'm planning to update from ubuntu 20.04 to 22.04, I had changed the config as below "source_ami_filter": { "filters": { "virtualization-type": "hvm", "name":…
2
votes
0 answers

packer to bake AMI from shared AMI and Share with other AWS Account

I am trying to create AMI with (shared AMI from another Account). since i do not have access to snapshot i cannot create or rename AMI so i opted to use Packer to Bake New AMI with needed custom Name. Since Shared AMI is encrypted so the newly…
mebb
  • 123
  • 10
2
votes
1 answer

PowerShell scripts fails for packer SSH communicator for Windows AMI

I'm trying to build a Windows AMI using Packer with the SSH communicator using AWS SSM session_manager (ssh_interface). Packer is able to connect to the builder Windows instance using SSH and session_manager but my PowerShell scripts are not…
nikhilsoman
  • 31
  • 1
  • 2
2
votes
1 answer

Running cloud-init twice via Packer & Terraform on VMware Ubuntu 22.04 guest

I would like to create VMs with varying CPU, RAM and network configuration from the same Ubuntu template in ESXi. When $ packer build -var-file=packer/variables.pkr.hcl -var-file=packer/secret.pkrvars.hcl packer/template.pkr.hcl is run, it reads the…
abestic9
  • 491
  • 5
  • 19
2
votes
2 answers

No connection could be made because the target machine actively refused it with packer for vagrant building with virtualbox

I try to create a Vagrant Box (virtualbox) with Packer into Windows 11 OS. I use a script which run correctly in the past but I don't know why this time I have SSH issue that cause impossible building. During the building packer I have this error…
miltone
  • 4,416
  • 11
  • 42
  • 76
2
votes
2 answers

how to set a variable as a list in packer for ansible?

When trying to pass a var that is normally a list in ansible, I cannot do this in packer. provisioner "ansible" { playbook_file = "./ansible/houdini_module.yaml" extra_arguments = [ "-vv", "--extra-vars", …
openCivilisation
  • 796
  • 1
  • 8
  • 25
2
votes
1 answer

Is it possible to change the image running on a virtual machine in Azure without recreating it

Our development environment has a bunch of virtual machines running different versions of our software. I want to be able to replace the Managed Image that is running on a VM, without having to destroy and recreate it. The images are created using…
Wessel van Lit
  • 83
  • 1
  • 11
2
votes
1 answer

Is it possilbe to setup your local environment with packer (like with ansible playbook)

I am trying to setup my development environment (on my local Linux pc) via some automatic mechanism. I tried ansible playbooks, they work quite well. Let's assume a playbook like this ("SetupDevEnv.yml") --- - hosts: localhost tasks: - name:…
user1911091
  • 1,219
  • 2
  • 14
  • 32
2
votes
2 answers

Packer with vagrant post-processor "ovf file couldn't be found"

I'm new to packer. I've heard that you can add a vagrant post processor to get you an easy VM to test your new image in. Based on the examples and such I thought the code below would work. However, I get this error. * Post-processor failed: ovf file…
FailureGod
  • 332
  • 1
  • 12