Questions tagged [packer]

Packer automates the creation of any type of machine image. It embraces modern configuration management by encouraging you to use automated scripts to install and configure the software within your Packer-made images.

Filter by
Sorted by
Tagged with
1
vote
1answer
47 views

Trying to understand sample windows 10 packer template at https://github.com/StefanScherer/packer-windows

I am a beginner to Packer. I am using a template found at https://github.com/StefanScherer/packer-windows for Windows 10, and have been able to create a virtual machine in Hyper-V using the template ...
1
vote
0answers
49 views

Build Windows image for openstack with packer

I am trying to build Windows image for Openstack with packer, but i don't know how to add the autounattend.xml file or floppy files. I build the image with success from qemu but I cannot find the same ...
2
votes
1answer
460 views

How do fail a Packer pipeline upon powershell provisioner pester test failure?

I'm building a packer pipeline and having an issue in getting the failure of a powershell provisioner step to fail the packer job itself. This is important as without failing the Packer job, the AMI ...
0
votes
2answers
81 views

Cannot install Ansible

So I am creating a packer template for docker with the image php:7.0-apache. I added a shell provisioner where I try to install ansible so I can provision the image: { "type": "shell", ...
1
vote
0answers
189 views

Why does an 'InvalidSnapshot.NotFound' occur in Packer and how to solve it? [closed]

When I'm running sudo packer2 build -debug template.json with this code: { "variables": { "profile": "aws", "region": "eu-west-1" }, "builders": [{ "type": "amazon-chroot", "profile": "{{...
3
votes
2answers
479 views

How to run a CMD in a docker container that was created using Packer?

So I am creating a docker image with packer. The template defines the provisioners and builders etc. The builder section looks like this: { "builders": [ { "type": "docker", ...
4
votes
1answer
1k views

Bridged network adapter for Packer + VirtualBox?

So, I load an .ova image with packer of a minimal ubuntu linux installation. I realized after everything went through (Provisioners etc) and it successfully exported the output file. However, when ...
0
votes
0answers
54 views

How to add Azure VM's admin user to a specific unix group?

I'm creating an Azure VM image using Packer. The VM is just a Debian 10 installation with a couple of packages installed. What I really need to do is to add VM admin user to a specific unix group (...
1
vote
0answers
94 views

How to rite output per builder into separate log files in Packer? [closed]

I have a few packer templates which have several builders - up to 5 per template. This makes it very easy to provision all the resources necessary in a pipeline -- however by default packer writes all ...
4
votes
1answer
777 views

How to download a VM image from GCP?

I do not see a download button. I would like to download a VM image that was created on GCP using Packer and I would like to run it locally in Virtualbox.
4
votes
2answers
2k views

Is it possible to locate the temp keypair generated by Packer?

I`m creating a new image and everything is working. I would like to debug via ssh during the instance creation. A temp keypair is created and attached to the temp instance. My question is, can I get ...
2
votes
1answer
54 views

Understanding Vagrant virtual machine import

I'm building my Windows server 2012 vm with packer and when I'm doing a vagrant up it's failing because the folder name already exists… Here is my json file for packer { "builders": [ { "...
0
votes
1answer
62 views

DevOps Newbie - How to automate windows infrastructure deployment?

DevOps newbie here, so bear with me. I have a project where infrastructure deployment and application deployment is done using powershell and it is tied to VMWare vCenter. For every client deployment,...
3
votes
2answers
123 views

Packer and compressed ISO images

I am not using packer yet, just looking through the documentation. Some VMs it supports can be built from iso images. The examples cover use cases where the ISO is available online through the iso_url ...
8
votes
4answers
2k views

Is there an idiomatic way to create reusable Packer templates?

I'm creating about 10-12 Packer templates which almost all work the same way. Same builder (Amazon EBS), with some small variations in AMI names, and almost the same provisioner (Ansible Remote) - ...
2
votes
1answer
166 views

Error when using 'ansible-local' provisioner with Docker container

I'm getting an error when running the ansible-local provisioner with a docker builder in Hashicorps Packer. My template (template.json): { "builders": [ { "type": "docker", ...
3
votes
1answer
250 views

Ansible Remote provisioning not working in Docker container build

I have a Packer template to start with a Docker container and provision it. The shell script provisioners seem to be working, but, while the playbook runs and seems to succeed, unlike the shell ...
2
votes
1answer
134 views

Parallelising Packer with Ansible

Issue I have an Ansible role which covers Windows, macOS and Ubuntu OS. I also have a Packer template file for each OS (due to small nuances and changes in the template file to handle provisioning) ...
6
votes
6answers
730 views

In the HashiCorp stack, where's the appropriate place to add users?

I'm in the process of building some custom Linux images using HashiCorp's Packer, which will later be deployed to Azure using HashiCorp's Terraform. The VMs created from these images will need to have ...
4
votes
1answer
225 views

difference between packer and matchbox

I have this setup to standup a baremetal machine: Terraform-> Matchbox \-> Chef-> Docker My colleague has a setup to standup VMs in AWS: Terraform-> Packer-> Chef-> ...
9
votes
3answers
377 views

How should we automatically rebuild immutable infrastructure when new packages are available?

We're going to be using Terraform to automate our infrastructure deployment and Packer to create the machine images deployed by Terraform. By following immutable infrastructure design principles, we ...
2
votes
1answer
419 views

Deploying to VSphere with Packer and/or Terraform?

Scenario: Creating multiple VMs and deploying them to VSphere. Current development uses Packer and Ansible to provision a Fusion VM, with the aim of using Terraform to deploy to VSphere. Issue: I'...
6
votes
1answer
3k views

What are reasons for using HashiCorp's packer to build docker images instead of using docker build?

I have read https://www.packer.io/docs/builders/docker.html, but I do not see the advantage of using Packer over docker build or docker-compose up --build for building docker images
5
votes
1answer
70 views

Storing Meta Data for Apps/tools

Have created a number of images via packer and soon coming to the conclusion that binaries/images soon rack up in qty and need to find away to store config data. We are going to use ansible to hold ...
4
votes
1answer
821 views

Force script to fail if “npm install” has network issues

With the current Github outage, I noticed a problem with my packer setup. In a nutshell, I have a packer setup where I call a shell script that looks like this: #!/bin/bash set -e ... npm install ... ...
5
votes
3answers
565 views

Baking Immutable Images

I am working on a project and we are trying to bake immutable images on containers as IaC. These images can have J2EE, .NET or Python apps on it. All OS patches should be applied to this image ...
3
votes
1answer
1k views

How does using packer and terraform in a CD pipeline compare to docker images built from git?

At work we have a Go CD pipeline for producing docker images, and scheduling docker containers with rancher. This works quite well. You can commit a change to the Docker image in Git, the pipeline ...
35
votes
5answers
8k views

How to avoid interactive dialogs when running “apt-get upgrade -y” in Ubuntu 16.04 when packaging with Packer?

I'm using Packer to create an AWS AMI based on an Ubuntu 16.04 image. In the beginning, I'm doing an upgrade: sudo apt-get update sudo apt-get upgrade -y Here is the relevant part of my provisioners ...
8
votes
3answers
1k views

How to remotely update AMI id in Jenkins EC2 plugin?

I have been looking for a way to update AMI id in Jenkins EC2 plugin configuration after a packer build is run. After some digging, I found a promising way to do it IF the packer run is done by ...