Questions tagged [packer]

Packer is a tool which automates building and provisioning of VM and Docker images.

Filter by
Sorted by
Tagged with
0
votes
0answers
16 views

HashiCorp packer with vshpere 7.0.2 : error mounting an image

Not sure if anyone using Packer to build images for vmware vsphere 7.0.2. Here is the error I am having and I dont know what does it mean by device 0 What is this Device 0? Here is the error: ==> ...
1
vote
0answers
16 views

How to end-to-end provision a virtual machine including OS on ESXi standalone using Terraform?

For a small environment I'm tasked to create automated infrastructure deployment for a couple of virtual machines running on a single ESXi host (without vCenter). The VMs should run CentOS 8 and I ...
0
votes
0answers
39 views

Using Packer for Kickstart Centos8-Stream Linux

So I'm working with Packer to construct base images for our various environments. It's my first time doing Packer, so, a lot of learning by fire. I've got the packer configuration able to talk to my ...
0
votes
1answer
84 views

Adding arguments to Packer's Ansible provisioner

My Friday brain is really struggling to convert an Ansible command line into the format my Packer .json wants. The Ansible: ansible-playbook playbook.yml -e @env/users/user01.yml --ask-vault --ask-...
0
votes
0answers
65 views

Troubleshooting block device mappings with Packer to increase size of EBS volume

I'd like to understand more about what to do when you need to increase a block device size for a build. I have some examples that work successfully with ubuntu 18, and centos 7 that I use, but it ...
0
votes
1answer
11 views

journalctl stops working randomly after boot on DigitalOcean droplet

I am building servers from a custom image I made using Packer on DigitalOcean, and I'm having a recurring issue where journalctl doesn't have any logs: # journalctl No journal files were found. ...
1
vote
1answer
47 views

OpenVPN AMI's built with packer incorrectly use the old public IP from the build in generated config files

When I build AMI's using Hashicorp Packer, based off the AWS OpenVPN AMI, the public ip address from the first instance performing the build will persist in later usage of the AMI when it should ...
0
votes
0answers
94 views

Heisenbug: ansible.windows.win_user fails with “Illegal operation attempted on a registry key that has been marked for deletion.”

Using Packer to build an AMI based on Windows Server 2019, and Ansible as provisioner. This is the provisioners part of my packer-build.json: "provisioners": [ { &...
0
votes
0answers
17 views

Disallow ec2 ssh key-pair login but allow a special ssh key to login

I have a use case that my product image only allow a specific ssh keypair (not distribute to customer, only support team has the keypair) to ssh to a VM. The AMI image is built by packer. Is it ...
0
votes
1answer
536 views

Replace WinRM with OpenSSH on Windows for use with Ansible on AWS

Currently when running extended builds (Packer/Ansible based) on Windows we have found that WinRM has errors so frequently as to be unusable and have had to fall back to running some large build jobs ...
1
vote
3answers
587 views

Can't connect to Windows EC2 instance built by Packer via SSM Agent

I'm using Packer to set up a Windows VM on the free tier of AWS EC2. The image is properly set up and I'm able to launch it, but I can't connect to it with SSM. Here's my Packer template: { "...
1
vote
1answer
629 views

Disconnected NIC on customized & deployed Ubuntu 18.04 templates

Within my vSphere 6.7 U3 environment, I have an Ubuntu 18.04 template generated by packer which I am then using Terraform to deploy two copies of. I am running into an issue where the deployed VMs ...
1
vote
1answer
651 views

Proxmox & Packer: VM quit/powerdown failed during a Packer build. Anyone have any ideas why?

I am trying to create a Proxmox VM template using Packer. However I am getting a Proxmox error saying Build 'proxmox' errored: Error converting VM to template, could not stop: VM quit/powerdown failed ...
0
votes
1answer
1k views

How to provide sudo pwd in packer shell provisioner

I want to create an AWS AMI using packer. Part of the setup process is running a build script, that will setup services and configure the environment for a system user averagejoe that is not root. The ...
0
votes
0answers
106 views

Cant run EC2 sysprep script with packer

THis is the last script I run in the manifest: { "type": "powershell", "inline": [ "Write-Host '===== Configure sysprep behaviour ====='"...
0
votes
0answers
1k views

Issues getting networking working Packer VSphere-ISO Centos 7

While new to Packer and Kickstart scripts, I am trying to automate the setup of CentOS 7 (eventually 8) boxes in a VSphere cluster. My Packer code is calling a Kickstart script to complete the setup, ...
0
votes
1answer
51 views

Make image with packer for Google cloud

when I user packer build command I face this error and I gave the service account user but still have same issue googlecompute: * The user does not have access to service account 'service-76109290228@...
3
votes
0answers
899 views

What the best way to export a Vagrant box to OVF?

My goal was to create a Virtual Machine programmatically like you would do for a container with docker and be able to export it in an OVF. So I used Vagrant to create the VM. Combining Vagrant and ...
0
votes
1answer
2k views

unable to ssh into local qemu instance via port forward

I am trying to build a custom Ubuntu (ISO built from bionic - 18.04.2) qcow2 image via packer. This fails in the step where packer tries to SSH to the instance via port forward. I can see from VNC ...
0
votes
1answer
321 views

How to update existing manage packer image in Azure?

I have created a ubuntu image by following code { "builders": [{ "type": "azure-arm", "subscription_id": "XXXXXX",XXXXXXXX "client_id": "XXXXXXX", "client_secret": "06XXXXXXX", ...
1
vote
1answer
131 views

Partially Immutable infrastructure in AWS with Packer?

I'm a very young systems engineer/contractor sysadmin with a bandwidth-heavy workload that just moved to an area where I get 2mbps download and 20 upload on my internet connection. I'm moving my ...
1
vote
1answer
408 views

How to provide ssh_username when using packer to build a windows AMI

When I run packer build -var aws_access_key=$AWS_ACCESS_KEY_ID -var aws_secret_key=$AWS_SECRET_ACCESS_KEY windows-2012.json I got this error: 1 error(s) occurred: * An ssh_username must be ...
0
votes
1answer
1k views

packer unable to parse json due to invalid character

I want to use packer to build an ami. The AMI was initially built by an aws_instance resource in terraform. It contains the following user_data <powershell> winrm quickconfig -q winrm set ...
0
votes
1answer
210 views

xenserver-iso: Error downloading: open : no such file or directory

I'm trying to build a "vdi_vhd" image using packer on xenserver,but i have got the below error, could you please anyone help me on this,Thanks in advance. [root@localhost bin]# packer build /usr/...
0
votes
1answer
114 views

cannot connect to ec2 instance created by packer image

I have written packer script to create image in aws. After executing the packer script it is running a ec2 instance which is using pem file created by packer. But how can I know which pem file packer ...
0
votes
1answer
472 views

Packer errors with qemu-system-aarch64

I have some success creating Vagrant base boxes with Packer for x86 and x86_64 guests, including VirtualBox, VMware, and qemu hypervisors. Now, I want to start making ARM guests with Packer and qemu, ...
-2
votes
1answer
1k views

Create a VM using terraform on an Azure image created by Packer

Team, I need to provision an Azure VM (Windows/Linux) and I followed the below link to create the image first. https://docs.microsoft.com/en-us/azure/virtual-machines/windows/build-image-with-packer ...
1
vote
0answers
790 views

Packer Works Locallly but fails in Gitlab CI/CD w/ executable file not found in $PATH

Here is a snippet of my JSON file for packer. Pretty much running packer build example.json via adhoc - it works smoothly and builds the AMI out in AWS. When i execute this in my GitLabCI Pipeline, it ...
2
votes
1answer
668 views

Packer failing sysprep on AWS windows 2016 AMI

Packer seems to fail at the Amazon Scripts to sysprep the machine. I have tried a bunch of different things. Putting the scripts in their own script, running, them 'inline' like many people show but ...
1
vote
1answer
364 views

Running VMWare Workstation 14 on a VM [closed]

I have set up VMWare Workstation on a esxi 6.0 hosted VM. (Ubuntu 16.04.05) I am trying to run some packer builds that use the specific (VMWare Workstation) hypervisor. The builds get stuck ...
4
votes
3answers
893 views

inconsistent `apt-get update` behaviour on official Ubuntu AWS AMI

I get various and inconsistent errors with apt on the official Ubuntu images (ami-83e769fb). I'm using Packer to build my AMI and it fails about 40% of the time. Rerunning the script succeeds. My ...
0
votes
1answer
181 views

serverspec nginx should be listening using packer

I am using packer to build an ami on aws, after the provision of the ami, I am testing the image using serverspec, but the test fail testing nginx, this is the test cat test/spec/localhost/...
0
votes
1answer
170 views

How do I use debconf in salt with pillars?

I have the following: newrelic-debconf: debconf.set: - name: newrelic-php5 - data: 'newrelic-php5/application-name': { 'type': 'string', 'value': '{{ salt['pillar.get']('newrelic:...
3
votes
0answers
3k views

How to pass environment variables to packer in AWS?

I am building a custom AMI in AWS using packer and bash + salt provisioning. However, I am in need of being able to pass some variables from my local environment to the build system and I don't really ...
1
vote
1answer
2k views

Packer with ansible from local works but from another server ask for root permissions

For a bit of context, I'm using packer with an ansible provisioner to create AMI images on AWS. The relevant parts of the packer and ansible: packer.json "provisioners": [{ "type": "shell", "...
2
votes
3answers
1k views

Removing install user with Packer

When a VM is first created, it gets an install user that is used to run the provisioning. I want to remove this user at the last step because it's not necessarily secure and it's unnecessary. However, ...
5
votes
1answer
3k views

Packer won't correctly use private key for SSH auth in provisioning step

I use Packer to build VirtualBox images, with the Ansible provisioner to set up the images. The builder step creates a temporary user (ssh_username and ssh_password). The Ansible provisioner runs ...
1
vote
0answers
40 views

Data disappears after launching EC2 instance from AMI

I am launching an EC2 instance out of an AMI that i am building using packer . In packer build i specify a provisioning shell script which will mount the drives as well as get some files from S3 ...
1
vote
2answers
2k views

Packer - AWS Windows 2016 SysPrep returns exit code 1

When attempting to SysPrep an AWS Windows Server 2016 instance using Packer the following error is thrown: Build 'amazon-ebs' errored: Script exited with non-zero exit status: 1. Allowed exit codes ...
2
votes
1answer
1k views

Building an AMI using Packer with a shell provisioner

I'm trying to create an AMI (based on ubuntu; ami-2d39803a) that I can reuse for a project with the a set of components installed. I'm using packer to achieve this with a shell script that gets ...
3
votes
2answers
2k views

Sysprepping with packer.io returns exit 1, packer doesn't create AMI

I'm trying to build a Windows AMI with packer.io. In the powershell file I have run the following command as the last command of the provisioning step: Write-Host "Running the EC2Config.exe file ...
0
votes
1answer
2k views

Using Packer to build a GCE with “error creating instance” error, next steps?

I've been working with using Packer v0.10.1 to build an image and am running into this access security issue when trying to run via Hashicorp's Atlas tool. Packer v0.10.1 [1;32mgooglecompute ...
3
votes
0answers
1k views

Qemu packer ssh failed connection reset by peer

I am trying to get packer to create a qemu/kvm image. I feel like it should be fairly straightforward but my build keeps failing on ssh. Here are the relevant files template.json: { "builders": [ { ...
0
votes
4answers
3k views

Using Packer with Google Cloud and getting an SSH connection issue w/ Debian Build

Here's my Packer file. { "variables": { "account_json": "{{env `packer_account_json`}}" }, "builders": [ { "type": "googlecompute", "account_file": "{{user ...
10
votes
1answer
8k views

Is there any way to provision bare-metal with Packer?

Can Packer be used to install and provision a bare metal server? Packer provides webserver with repository packages and preseed/kickstart and can run some other provision softwares(ansible,puppet, ...
0
votes
1answer
635 views

Ansible not executing within Packer Build

I am currently experimenting with deploying using Packer’s Ansible local provisioning and for some odd reason, it doesn’t appear to be executing the tasks in the playbook. Packer, after installing ...
2
votes
2answers
5k views

How to debug “Select and install software” issue with unattended Ubuntu install (14.04)

I am using Packer to build a VirtualBox image for Ubuntu 14.04. I have a Packer script here, which used to work, but then for some reason (and several VirtualBox updates later) started failing. The ...
4
votes
1answer
117 views

Why are Puppet effects disappearing after Packer post-process?

I decided to learn Packer by putting together a FreeBSD Vagrant box. The whole setup is on GitHub. Everything works well until the post-processing stage. Actually, that stage likewise claims to ...
2
votes
1answer
8k views

How to create a Docker image by downloading an ISO using Packer?

It is possible to create images from scratch using Packer by downloading an ISO from the internet. Aim: to create Docker images by downloading an ISO using Packer Attempts Attempt 1 It is ...
9
votes
3answers
5k views

Passing variables to use in the preseed file for a Debian Jessie installation

Is it possible to add a variable via the boot prompt to the Debian installer, so that variable can be used in a preseed file? In particular, I'm trying to solve the following problem: We have a ...