· 8 years ago · May 15, 2017, 10:36 PM
1$ cat ~/.aws/credentials
2
3[packertest]
4aws_access_key_id = XXX
5aws_secret_access_key = XXX
6
7$ aws --profile packertest ec2 describe-availability-zones
8{
9 "AvailabilityZones": [
10 {
11 "State": "available",
12 "RegionName": "us-east-1",
13...
14
15$ cat profile.json
16{
17 "builders": [
18 {
19 "type": "amazon-ebs",
20 "profile": "packertest",
21 "region": "us-east-1",
22 "vpc_id": "vpc-XXXX",
23 "subnet_id": "subnet-XXXX",
24 "source_ami": "ami-XXXX",
25 "instance_type": "t2.medium",
26 "ssh_username": "centos",
27 "ssh_pty": true,
28 "ssh_private_ip": true,
29 "ami_name": "profiletest"
30 }
31 ]
32}$
33$
34$ PACKER_LOG=1 packer build profile.json
352017/05/15 17:22:29 [INFO] Packer version: 1.0.0
362017/05/15 17:22:29 Packer Target OS/Arch: darwin amd64
372017/05/15 17:22:29 Built with Go Version: go1.8.1
382017/05/15 17:22:29 Detected home directory from env var: /Users/12345
392017/05/15 17:22:29 Using internal plugin for amazon-ebssurrogate
402017/05/15 17:22:29 Using internal plugin for amazon-instance
412017/05/15 17:22:29 Using internal plugin for cloudstack
422017/05/15 17:22:29 Using internal plugin for file
432017/05/15 17:22:29 Using internal plugin for amazon-ebsvolume
442017/05/15 17:22:29 Using internal plugin for googlecompute
452017/05/15 17:22:29 Using internal plugin for null
462017/05/15 17:22:29 Using internal plugin for profitbricks
472017/05/15 17:22:29 Using internal plugin for vmware-iso
482017/05/15 17:22:29 Using internal plugin for virtualbox-ovf
492017/05/15 17:22:29 Using internal plugin for vmware-vmx
502017/05/15 17:22:29 Using internal plugin for amazon-ebs
512017/05/15 17:22:29 Using internal plugin for digitalocean
522017/05/15 17:22:29 Using internal plugin for hyperv-iso
532017/05/15 17:22:29 Using internal plugin for parallels-iso
542017/05/15 17:22:29 Using internal plugin for qemu
552017/05/15 17:22:29 Using internal plugin for parallels-pvm
562017/05/15 17:22:29 Using internal plugin for triton
572017/05/15 17:22:29 Using internal plugin for virtualbox-iso
582017/05/15 17:22:29 Using internal plugin for amazon-chroot
592017/05/15 17:22:29 Using internal plugin for azure-arm
602017/05/15 17:22:29 Using internal plugin for docker
612017/05/15 17:22:29 Using internal plugin for oneandone
622017/05/15 17:22:29 Using internal plugin for openstack
632017/05/15 17:22:29 Using internal plugin for salt-masterless
642017/05/15 17:22:29 Using internal plugin for shell
652017/05/15 17:22:29 Using internal plugin for shell-local
662017/05/15 17:22:29 Using internal plugin for ansible-local
672017/05/15 17:22:29 Using internal plugin for chef-solo
682017/05/15 17:22:29 Using internal plugin for file
692017/05/15 17:22:29 Using internal plugin for windows-shell
702017/05/15 17:22:29 Using internal plugin for windows-restart
712017/05/15 17:22:29 Using internal plugin for ansible
722017/05/15 17:22:29 Using internal plugin for converge
732017/05/15 17:22:29 Using internal plugin for puppet-masterless
742017/05/15 17:22:29 Using internal plugin for chef-client
752017/05/15 17:22:29 Using internal plugin for powershell
762017/05/15 17:22:29 Using internal plugin for puppet-server
772017/05/15 17:22:29 Using internal plugin for compress
782017/05/15 17:22:29 Using internal plugin for googlecompute-export
792017/05/15 17:22:29 Using internal plugin for amazon-import
802017/05/15 17:22:29 Using internal plugin for shell-local
812017/05/15 17:22:29 Using internal plugin for vsphere
822017/05/15 17:22:29 Using internal plugin for vagrant
832017/05/15 17:22:29 Using internal plugin for artifice
842017/05/15 17:22:29 Using internal plugin for docker-import
852017/05/15 17:22:29 Using internal plugin for docker-push
862017/05/15 17:22:29 Using internal plugin for docker-save
872017/05/15 17:22:29 Using internal plugin for vagrant-cloud
882017/05/15 17:22:29 Using internal plugin for atlas
892017/05/15 17:22:29 Using internal plugin for checksum
902017/05/15 17:22:29 Using internal plugin for docker-tag
912017/05/15 17:22:29 Using internal plugin for manifest
922017/05/15 17:22:29 Detected home directory from env var: /Users/12345
932017/05/15 17:22:29 Attempting to open config file: /Users/12345/.packerconfig
942017/05/15 17:22:29 [WARN] Config file doesn't exist: /Users/12345/.packerconfig
952017/05/15 17:22:29 Packer config: &{DisableCheckpoint:false DisableCheckpointSignature:false PluginMinPort:10000 PluginMaxPort:25000 Builders:map[cloudstack:/usr/local/Cellar/packer/1.0.0/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-cloudstack null:/usr/local/Cellar/packer/1.0.0/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-null profitbricks:/usr/local/Cellar/packer/1.0.0/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-profitbricks virtualbox-ovf:/usr/local/Cellar/packer/1.0.0/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-virtualbox-ovf digitalocean:/usr/local/Cellar/packer/1.0.0/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-digitalocean qemu:/usr/local/Cellar/packer/1.0.0/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-qemu virtualbox-iso:/usr/local/Cellar/packer/1.0.0/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-virtualbox-iso amazon-ebssurrogate:/usr/local/Cellar/packer/1.0.0/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-amazon-ebssurrogate file:/usr/local/Cellar/packer/1.0.0/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-file openstack:/usr/local/Cellar/packer/1.0.0/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-openstack azure-arm:/usr/local/Cellar/packer/1.0.0/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-azure-arm docker:/usr/local/Cellar/packer/1.0.0/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-docker vmware-iso:/usr/local/Cellar/packer/1.0.0/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-vmware-iso vmware-vmx:/usr/local/Cellar/packer/1.0.0/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-vmware-vmx amazon-ebs:/usr/local/Cellar/packer/1.0.0/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-amazon-ebs parallels-iso:/usr/local/Cellar/packer/1.0.0/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-parallels-iso parallels-pvm:/usr/local/Cellar/packer/1.0.0/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-parallels-pvm amazon-instance:/usr/local/Cellar/packer/1.0.0/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-amazon-instance amazon-ebsvolume:/usr/local/Cellar/packer/1.0.0/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-amazon-ebsvolume triton:/usr/local/Cellar/packer/1.0.0/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-triton amazon-chroot:/usr/local/Cellar/packer/1.0.0/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-amazon-chroot oneandone:/usr/local/Cellar/packer/1.0.0/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-oneandone googlecompute:/usr/local/Cellar/packer/1.0.0/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-googlecompute hyperv-iso:/usr/local/Cellar/packer/1.0.0/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-hyperv-iso] PostProcessors:map[googlecompute-export:/usr/local/Cellar/packer/1.0.0/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-googlecompute-export manifest:/usr/local/Cellar/packer/1.0.0/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-manifest amazon-import:/usr/local/Cellar/packer/1.0.0/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-amazon-import vsphere:/usr/local/Cellar/packer/1.0.0/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-vsphere docker-import:/usr/local/Cellar/packer/1.0.0/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-docker-import docker-save:/usr/local/Cellar/packer/1.0.0/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-docker-save vagrant-cloud:/usr/local/Cellar/packer/1.0.0/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-vagrant-cloud compress:/usr/local/Cellar/packer/1.0.0/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-compress atlas:/usr/local/Cellar/packer/1.0.0/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-atlas checksum:/usr/local/Cellar/packer/1.0.0/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-checksum shell-local:/usr/local/Cellar/packer/1.0.0/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-shell-local vagrant:/usr/local/Cellar/packer/1.0.0/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-vagrant artifice:/usr/local/Cellar/packer/1.0.0/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-artifice docker-push:/usr/local/Cellar/packer/1.0.0/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-docker-push docker-tag:/usr/local/Cellar/packer/1.0.0/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-docker-tag] Provisioners:map[shell-local:/usr/local/Cellar/packer/1.0.0/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-shell-local windows-shell:/usr/local/Cellar/packer/1.0.0/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-windows-shell chef-client:/usr/local/Cellar/packer/1.0.0/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-chef-client puppet-server:/usr/local/Cellar/packer/1.0.0/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-puppet-server salt-masterless:/usr/local/Cellar/packer/1.0.0/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-salt-masterless ansible-local:/usr/local/Cellar/packer/1.0.0/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-ansible-local chef-solo:/usr/local/Cellar/packer/1.0.0/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-chef-solo converge:/usr/local/Cellar/packer/1.0.0/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-converge powershell:/usr/local/Cellar/packer/1.0.0/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-powershell shell:/usr/local/Cellar/packer/1.0.0/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-shell file:/usr/local/Cellar/packer/1.0.0/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-file windows-restart:/usr/local/Cellar/packer/1.0.0/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-windows-restart puppet-masterless:/usr/local/Cellar/packer/1.0.0/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-puppet-masterless ansible:/usr/local/Cellar/packer/1.0.0/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-ansible]}
962017/05/15 17:22:29 Setting cache directory: /Users/12345/git/np-infra/ce-base-nodeploy/packer/packer_cache
972017/05/15 17:22:29 Detected home directory from env var: /Users/12345
982017/05/15 17:22:29 Loading builder: amazon-ebs
992017/05/15 17:22:29 Plugin could not be found. Checking same directory as executable.
1002017/05/15 17:22:29 Current exe path: /usr/local/Cellar/packer/1.0.0/bin/packer
1012017/05/15 17:22:29 Creating plugin client for path: /usr/local/Cellar/packer/1.0.0/bin/packer
1022017/05/15 17:22:29 Starting plugin: /usr/local/Cellar/packer/1.0.0/bin/packer []string{"/usr/local/Cellar/packer/1.0.0/bin/packer", "plugin", "packer-builder-amazon-ebs"}
1032017/05/15 17:22:29 Waiting for RPC address for: /usr/local/Cellar/packer/1.0.0/bin/packer
1042017/05/15 17:22:29 packer: 2017/05/15 17:22:29 [INFO] Packer version: 1.0.0
1052017/05/15 17:22:29 packer: 2017/05/15 17:22:29 Packer Target OS/Arch: darwin amd64
1062017/05/15 17:22:29 packer: 2017/05/15 17:22:29 Built with Go Version: go1.8.1
1072017/05/15 17:22:29 packer: 2017/05/15 17:22:29 Detected home directory from env var: /Users/12345
1082017/05/15 17:22:29 packer: 2017/05/15 17:22:29 Attempting to open config file: /Users/12345/.packerconfig
1092017/05/15 17:22:29 packer: 2017/05/15 17:22:29 [WARN] Config file doesn't exist: /Users/12345/.packerconfig
1102017/05/15 17:22:29 packer: 2017/05/15 17:22:29 Packer config: &{DisableCheckpoint:false DisableCheckpointSignature:false PluginMinPort:10000 PluginMaxPort:25000 Builders:map[] PostProcessors:map[] Provisioners:map[]}
1112017/05/15 17:22:29 packer: 2017/05/15 17:22:29 Setting cache directory: /Users/12345/git/np-infra/ce-base-nodeploy/packer/packer_cache
1122017/05/15 17:22:29 packer: 2017/05/15 17:22:29 Detected home directory from env var: /Users/12345
1132017/05/15 17:22:29 packer: 2017/05/15 17:22:29 args: []string{"packer-builder-amazon-ebs"}
1142017/05/15 17:22:29 packer: 2017/05/15 17:22:29 Plugin minimum port: 10000
1152017/05/15 17:22:29 packer: 2017/05/15 17:22:29 Plugin maximum port: 25000
1162017/05/15 17:22:29 packer: 2017/05/15 17:22:29 Plugin address: unix /var/folders/kh/w11nblhx105d1w928r163pp0_3h46n/T/packer-plugin099279162
1172017/05/15 17:22:29 packer: 2017/05/15 17:22:29 Waiting for connection...
1182017/05/15 17:22:29 packer: 2017/05/15 17:22:29 Serving a plugin connection...
1192017/05/15 17:22:29 ui: amazon-ebs output will be in this color.
1202017/05/15 17:22:29 ui:
1212017/05/15 17:22:29 Build debug mode: false
1222017/05/15 17:22:29 Force build: false
1232017/05/15 17:22:29 On error:
1242017/05/15 17:22:29 Preparing build: amazon-ebs
125amazon-ebs output will be in this color.
126
1272017/05/15 17:22:29 packer: 2017/05/15 17:22:29 Config: {PackerConfig:{PackerBuildName:amazon-ebs PackerBuilderType:amazon-ebs PackerDebug:false PackerForce:false PackerOnError: PackerUserVars:map[]} AccessConfig:{AccessKey: SecretKey: RawRegion:us-east-1 SkipValidation:false Token: ProfileName:packertest} AMIConfig:{AMIName:profiletest AMIDescription: AMIVirtType: AMIUsers:[] AMIGroups:[] AMIProductCodes:[] AMIRegions:[] AMISkipRegionValidation:false AMITags:map[] AMIEnhancedNetworking:false AMIForceDeregister:false AMIForceDeleteSnapshot:false AMIEncryptBootVolume:false AMIKmsKeyId: SnapshotTags:map[] SnapshotUsers:[] SnapshotGroups:[]} BlockDevices:{AMIBlockDevices:{AMIMappings:[]} LaunchBlockDevices:{LaunchMappings:[]}} RunConfig:{AssociatePublicIpAddress:false AvailabilityZone: EbsOptimized:false IamInstanceProfile: InstanceType:t2.medium RunTags:map[] SourceAmi:ami-XXXX SourceAmiFilter:{Filters:map[] Owners:[] MostRecent:false} SpotPrice: SpotPriceAutoProduct: DisableStopInstance:false SecurityGroupId: SecurityGroupIds:[] SubnetId:subnet-XXXX TemporaryKeyPairName:packer_591a1c15-b327-a4c9-c92e-2fcad535fbd9 UserData: UserDataFile: WindowsPasswordTimeout:20m0s VpcId:vpc-XXXX InstanceInitiatedShutdownBehavior:stop Comm:{Type:ssh SSHHost: SSHPort:22 SSHUsername:centos SSHPassword: SSHPrivateKey: SSHPty:true SSHTimeout:5m0s SSHAgentAuth:false SSHDisableAgent:false SSHHandshakeAttempts:10 SSHBastionHost: SSHBastionPort:0 SSHBastionUsername: SSHBastionPassword: SSHBastionPrivateKey: SSHFileTransferMethod:scp WinRMUser: WinRMPassword: WinRMHost: WinRMPort:0 WinRMTimeout:0s WinRMUseSSL:false WinRMInsecure:false WinRMTransportDecorator:<nil>} SSHKeyPairName: SSHPrivateIp:true} VolumeRunTags:map[] ctx:{Data:<nil> Funcs:map[clean_ami_name:0x173b950] UserVariables:map[] EnableEnv:false BuildName:amazon-ebs BuildType:amazon-ebs TemplatePath:/Users/12345/git/np-infra/ce-base-nodeploy/packer/profile.json}}
1282017/05/15 17:22:29 Waiting on builds to complete...
1292017/05/15 17:22:29 Starting build run: amazon-ebs
1302017/05/15 17:22:29 Running builder: amazon-ebs
1312017/05/15 17:22:29 ui error: Build 'amazon-ebs' errored: error when getting section: section 'profile packertest' not exists
1322017/05/15 17:22:29 Builds completed. Waiting on interrupt barrier...
1332017/05/15 17:22:29 machine readable: error-count []string{"1"}
1342017/05/15 17:22:29 ui error:
135==> Some builds didn't complete successfully and had errors:
1362017/05/15 17:22:29 machine readable: amazon-ebs,error []string{"error when getting section: section 'profile packertest' not exists"}
1372017/05/15 17:22:29 ui error: --> amazon-ebs: error when getting section: section 'profile packertest' not exists
1382017/05/15 17:22:29 ui:
139==> Builds finished but no artifacts were created.
1402017/05/15 17:22:29 waiting for all plugin processes to complete...
141Build 'amazon-ebs' errored: error when getting section: section 'profile packertest' not exists
142
143==> Some builds didn't complete successfully and had errors:
144--> amazon-ebs: error when getting section: section 'profile packertest' not exists
145
146==> Builds finished but no artifacts were created.
1472017/05/15 17:22:29 /usr/local/Cellar/packer/1.0.0/bin/packer: plugin process exited