packer

Installing PAR::Packer on Windows, dmake error 255

柔情痞子 提交于 2019-12-11 00:08:26
问题 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 XP SP3 32bit Virtual Machine to try and compile my source file; something that I was easily able to do on Linux. Strawberry perl installs fine however when I try to install the PAR::Packer module from cpan, I get the following errors: dmake: Error

How to use AWS roles with Packer to create AMIs

我们两清 提交于 2019-12-10 15:23:22
问题 I'm currently building AMIs via Packer without a problem, but I am baking the AWS credentials into my scripts which is not what I want. Reading the Packer documentation they specify that if no credentials are found it can use an AWS role. I have created the policy and the role, but it's unclear to me how to tell Packer to use this role. Do I have to pass the ARN in as a variable? Any thoughts? 回答1: Roles only apply to instances running on AWS , and roles can only be applied when you create an

How to copy a file to host during packer provisioning?

萝らか妹 提交于 2019-12-08 17:19:10
问题 I would like to generate a public/private ssh key pair during packer provisioning and copy the files to the host machine. Is there a way to copy files out from the VM to the host using packer? 回答1: I figured it out. The file provisioner has a "direction" option that allows download instead of upload { "type": "file", "source": "app.tar.gz", "destination": "/tmp/app.tar.gz", "direction" : "download" } 来源: https://stackoverflow.com/questions/36511571/how-to-copy-a-file-to-host-during-packer

How to pass argument in packer provision script?

≡放荡痞女 提交于 2019-12-08 15:58:27
问题 I am struggling to pass input parameter to packer provisioning script. I have tried various options but no joy. Objective is my provision.sh should accept input parameter which I send during packer build. packer build -var role=abc test.json I am able to get the user variable in json file however I am unable to pass it provision script. I have to make a decision based on the input parameter. I tried something like "provisioners": { "type": "shell", "scripts": [ "provision.sh {{user `role`}}"

SSH failed when building RancherOS with Packer

百般思念 提交于 2019-12-07 10:22:21
问题 I have an issue with Packer and RancherOS. I'm trying to build a custom rancherOS image with a cloud-config file. I'm working on MacOSX. I have this build.json file { "variables": { "vm_name" : "" }, "builders": [ { "type": "vmware-iso", "iso_url": "rancheros.iso", "guest_os_type": "other", "iso_checksum_type": "md5", "iso_checksum": "467caa8394684ba54e8731aed8480652", "output_directory": "output_rancheros", "ssh_wait_timeout": "30s", "shutdown_command": "sudo shutdown -h now", "disk_size":

Ansible jenkins_plugin module returns “HTTP Error 403: No valid crumb was included in the request”

浪子不回头ぞ 提交于 2019-12-06 05:35:18
I am using Ansible (v 2.8) as the provisioner behind a Packer template to build an AMI for a Jenkins master node. For previous versions, the playbook passed successfully. However, as of Jenkins version 2.176.3, the jenkins_plugin module has been throwing: HTTP Error 403: No valid crumb was included in the request I have retrieved the crumb and registered it in a variable. I have tried passing it to jenkins_plugin with the http_agent field, but that doesn't work. I tried using attributes , but that didn't help either. Unless I am missing something incredibly basic, I am at the end of my tether.

SSH failed when building RancherOS with Packer

六眼飞鱼酱① 提交于 2019-12-05 17:40:15
I have an issue with Packer and RancherOS. I'm trying to build a custom rancherOS image with a cloud-config file. I'm working on MacOSX. I have this build.json file { "variables": { "vm_name" : "" }, "builders": [ { "type": "vmware-iso", "iso_url": "rancheros.iso", "guest_os_type": "other", "iso_checksum_type": "md5", "iso_checksum": "467caa8394684ba54e8731aed8480652", "output_directory": "output_rancheros", "ssh_wait_timeout": "30s", "shutdown_command": "sudo shutdown -h now", "disk_size": 20000, "ssh_username": "rancher", "ssh_password": "rancher", "ssh_port": 22, "ssh_wait_timeout": "90m",

Docker image format

自闭症网瘾萝莉.ら 提交于 2019-12-04 16:51:09
问题 I would like to build a Docker image without docker iself. I have looked at Packer, but it requiers to have Docker installed on the builder host. I have looked at the Docker Registry API documentation but this information doesn't appear to be there. I guess that the image is simply a tarball, but I would like to see a complete specification of the format, i.e. what exect format is required and whethere there are any metadata files required. I could attempt downloading an image from the

How to make EC2 user-data work on freshly built AMI, made with Packer

回眸只為那壹抹淺笑 提交于 2019-12-04 08:15:00
I can build AMI images just fine. But they've stopped working with EC2 User Data: There is user data: $ cat /tmp/user_data.sh #!/bin/bash touch /tmp/i_have_user_data /root/i_have_user_data And I can launch a plain Ubuntu image: aws ec2 run-instances --instance-type m3.medium --image-id ami-eed10e86 --user-data file:///tmp/user_data.sh And it works: ubuntu@ip-10-165-90-180:~$ ls /tmp/i_have_user_data /tmp/i_have_user_data But if I build an AMI based on that one, with Packer: "builders": [ { "type": "amazon-ebs", "region": "us-east-1", "source_ami": "ami-eed10e86", "instance_type": "m3.large",

AWS user_data with Packer

假如想象 提交于 2019-12-04 03:10:31
So I'm trying to use Packer to create an AWS image and specify some user data via user_data_file. The contents of this file needs to be run when the instance boots as it will be unique each time. I can't bake this into the AMI. Using packer I have the following: { "variables": { "ami_name": "" }, "builders": [ { "type": "amazon-ebs", "region": "us-east-1", "source_ami": "ami-c8580bdf", "instance_type": "t2.micro", "ssh_username": "ubuntu", "ami_name": "{{ user `ami_name` }}-{{ isotime | clean_ami_name }}", "user_data_file": "user_data.sh", "tags": { "os_version": "ubuntu", "built_by": "packer"