packer

CloudFormation - Partitioning EBS root volume

一个人想着一个人 提交于 2020-01-06 08:06:14
问题 Below is the cloudformation template to create EC2 instance: "EC2Instance":{ "Type": "AWS::EC2::Instance", "Properties":{ "ImageId": "ami-099999999999a27", "InstanceType": "t2.micro", "SubnetId": { "Ref": "SubnetId"}, "KeyName": { "Ref": "KeyName"}, "SecurityGroupIds": [ { "Ref": "EC2InstanceSecurityGroup"} ], "IamInstanceProfile": { "Ref" : "EC2InstanceProfile"}, "UserData":{ "Fn::Base64": { "Fn::Join": ["", [ "#!/bin/bash\n", "echo ECS_CLUSTER=", { "Ref": "EcsCluster" }, " >> /etc/ecs/ecs

AWS user_data with Packer

旧街凉风 提交于 2020-01-01 08:53:33
问题 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

handshake failed: ssh: unable to authenticate, attempted methods [none password keyboard-interactive], no supported methods remain

二次信任 提交于 2019-12-25 00:23:05
问题 The problem in this question resembles SSH failed when building RancherOS with Packer However, the behavior of my Packer is different. I get ==> virtualbox-iso: Error waiting for SSH: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none password keyboard- interactive], no supported methods remain I am not sure why Packer is not able to ssh into the VM. I can see VirtualBox Console Screen sits on a login input. Then it timeouts and gets discarded by packer's process.

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

99封情书 提交于 2019-12-22 10:40:38
问题 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

How we can fetch code from Gitlab when create image using packer?

早过忘川 提交于 2019-12-13 08:55:48
问题 I am creating image using packer. I have used 2 provisioners i.e Shell and ansible-local and both are working fine and installed all the required packages. But now i need to deploy my application code too into my image which is over Gitlab. I am out of idea how we can do this. Can you please help me how we can fetch the code from Gitlab to create image using packer? Any assistance will be appreciated. Thanks. 回答1: You should use ssh agent forwarding . On the host running Packer load a ssh key

Building packer causes permission denied error

杀马特。学长 韩版系。学妹 提交于 2019-12-12 03:21:49
问题 I am trying to build packer and I am getting this error: go install golang.org/x/tools/cmd/vet: open /usr/lib/go/pkg/tool/linux_amd64/vet: permission denied Makefile:40: recipe for target 'test' failed make: *** [test] Error 1 Is the installer trying to access my /usr folder? Should I run this under root? How can I fix this? 回答1: go vet is special, in that it's a tool that needs to go in GOROOT. In most installations GOROOT is also user writable, but if you installed via a package manager it

How to create windows image in packer using the keypair

夙愿已清 提交于 2019-12-12 01:46:42
问题 I am creating the windows image with username and password using packer. It is working fine. I can able to create image. My requirement is i need to create the windows image with key pair using packer. I have searched a lot but not found any document to create windows image with key pair. Please let me know how to do this using packer. 回答1: It's hard to understand your exact question but I'll make a guess. You want to build a Windows AMI which when launched sets a random Administrator

Issue with using winrm user different from “packer_user” with Google Cloud Platform

南楼画角 提交于 2019-12-11 18:48:39
问题 I faced an issue using packer 1.4.3. At first I faced an issue, which described in #8085 (https://circleci.com/gh/hashicorp/packer/12207#artifacts/containers/0 version) . It was successfully fixed with downloading mentioned packer version. Currently I'm building Windows-2019 and Windows-2016 in Google Cloud Platform with packer. It works in proper way when I mention "winrm_username": "packer_user", if I use "winrm_username": "Adminitstator" or "winrm_username": "administator", I have an error

Packer - Assign specific Elastic IP to instance

和自甴很熟 提交于 2019-12-11 12:03:30
问题 When I fire up an EC2 instance with Packer, in order to create an AMI, is there a way to assign it a specific elastic IP address, assuming I already own that IP address? 回答1: I would use the Shell Provisioner to run a simple to script, uploaded with the File Provisioner to your Packer instance. The script would utilize the AWS CLI calling associate-ipaddress for this instance. 来源: https://stackoverflow.com/questions/32061542/packer-assign-specific-elastic-ip-to-instance

how to copy AMI from one aws account to other aws account?

末鹿安然 提交于 2019-12-11 07:39:16
问题 Am trying to copy the custom built ami using packer from one AWS account to another AWS account; however, i was able to copy ami across regions within one account. "builders": [{ "account_id": "12345678910", "s3_bucket": "xyz/xqas/asd", "x509_cert_path": "/Users/txyz/packer/certificate.pem", "x509_key_path": "/Users/txyz/packer/private-key.pem", "type": "amazon-instance", "access_key": "{{user access_key }}", "secret_key": "{{user secret_key }}", "region": "us-east-1", "source_ami": "ami