Created
November 9, 2014 23:39
-
-
Save kikitux/4430a102d4a30a7c17c5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"variables": { | |
"aws_access_key": "", | |
"aws_secret_key": "" | |
}, | |
"builders": [ | |
{ | |
"type": "amazon-ebs", | |
"access_key": "{{user `aws_access_key`}}", | |
"secret_key": "{{user `aws_secret_key`}}", | |
"region": "ap-southeast-2", | |
"source_ami": "ami-1f117325", | |
"instance_type": "t1.micro", | |
"ssh_username": "ubuntu", | |
"ami_name": "packer-{{timestamp}}" | |
} | |
], | |
"provisioners": [ | |
{ | |
"type": "shell", | |
"only": ["amazon-ebs"], | |
"inline": ["mkdir -p /home/ubuntu/.ssh/"] | |
}, | |
{ | |
"type": "file", | |
"only": ["amazon-ebs"], | |
"source": "/Users/kikitux/.ssh/id_rsa.pub", | |
"destination": "/home/ubuntu/.ssh/authorized_keys" | |
}, | |
{ | |
"type": "shell", | |
"only": ["amazon-ebs"], | |
"inline": ["sudo chmod -R 0600 /home/ubuntu/.ssh/; sudo chmod 0700 /home/ubuntu/.ssh/"] | |
} | |
] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[1;32mamazon-ebs output will be in this color.[0m | |
[1;32m==> amazon-ebs: Inspecting the source AMI...[0m | |
[1;32m==> amazon-ebs: Creating temporary keypair: packer 545ff0f5-9174-6895-327d-44be0be1f424[0m | |
[1;32m==> amazon-ebs: Creating temporary security group for this instance...[0m | |
[1;32m==> amazon-ebs: Authorizing SSH access on the temporary security group...[0m | |
[1;32m==> amazon-ebs: Launching a source AWS instance...[0m | |
[0;32m amazon-ebs: Instance ID: i-1bfe75d4[0m | |
[1;32m==> amazon-ebs: Waiting for instance (i-1bfe75d4) to become ready...[0m | |
[1;32m==> amazon-ebs: Waiting for SSH to become available...[0m | |
[1;32m==> amazon-ebs: Connected to SSH![0m | |
[1;32m==> amazon-ebs: Provisioning with shell script: /var/folders/zg/dw2mgnh135l9976wfs62tsmh0000gp/T/packer-shell985537322[0m | |
[0;32m amazon-ebs:[0m | |
[0;32m amazon-ebs:[0m | |
[0;32m amazon-ebs:[0m | |
[0;32m amazon-ebs:[0m | |
[0;32m amazon-ebs:[0m | |
[0;32m amazon-ebs:[0m | |
[0;32m amazon-ebs:[0m | |
[1;32m==> amazon-ebs: Uploading /Users/kikitux/.ssh/id_rsa.pub => /home/ubuntu/.ssh/authorized_keys[0m | |
[1;32m==> amazon-ebs: Provisioning with shell script: /var/folders/zg/dw2mgnh135l9976wfs62tsmh0000gp/T/packer-shell246848067[0m | |
[1;32m==> amazon-ebs: Stopping the source instance...[0m | |
[1;32m==> amazon-ebs: Waiting for the instance to stop...[0m | |
[1;32m==> amazon-ebs: Creating the AMI: packer-1415573748[0m | |
[0;32m amazon-ebs: AMI: ami-9d81eea7[0m | |
[1;32m==> amazon-ebs: Waiting for AMI to become ready...[0m | |
[1;32m==> amazon-ebs: Terminating the source AWS instance...[0m | |
[1;32m==> amazon-ebs: Deleting temporary security group...[0m | |
[1;32m==> amazon-ebs: Deleting temporary keypair...[0m | |
[1;32mBuild 'amazon-ebs' finished.[0m | |
==> Builds finished. The artifacts of successful builds are: | |
--> amazon-ebs: AMIs were created: | |
ap-southeast-2: ami-9d81eea7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"variables": { | |
"aws_access_key": "", | |
"aws_secret_key": "", | |
"ssh_private_key_file": "/Users/kikitux/.ssh/id_rsa" | |
}, | |
"builders": [ | |
{ | |
"type": "amazon-ebs", | |
"access_key": "{{user `aws_access_key`}}", | |
"secret_key": "{{user `aws_secret_key`}}", | |
"region": "ap-southeast-2", | |
"ssh_private_key_file": "{{user `ssh_private_key_file`}}", | |
"source_ami": "ami-9d81eea7", | |
"instance_type": "t1.micro", | |
"ssh_username": "ubuntu", | |
"ami_name": "packer-{{timestamp}}" | |
} | |
], | |
"provisioners": [ | |
{ | |
"type": "shell", | |
"only": ["amazon-ebs"], | |
"inline": ["touch second base"] | |
} | |
] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[1;32mamazon-ebs output will be in this color.[0m | |
[1;32m==> amazon-ebs: Inspecting the source AMI...[0m | |
[1;32m==> amazon-ebs: Creating temporary security group for this instance...[0m | |
[1;32m==> amazon-ebs: Authorizing SSH access on the temporary security group...[0m | |
[1;32m==> amazon-ebs: Launching a source AWS instance...[0m | |
[0;32m amazon-ebs: Instance ID: i-7dfc77b2[0m | |
[1;32m==> amazon-ebs: Waiting for instance (i-7dfc77b2) to become ready...[0m | |
[1;32m==> amazon-ebs: Waiting for SSH to become available...[0m | |
[1;32m==> amazon-ebs: Connected to SSH![0m | |
[1;32m==> amazon-ebs: Provisioning with shell script: /var/folders/zg/dw2mgnh135l9976wfs62tsmh0000gp/T/packer-shell241255542[0m | |
[1;32m==> amazon-ebs: Stopping the source instance...[0m | |
[1;32m==> amazon-ebs: Waiting for the instance to stop...[0m | |
[1;32m==> amazon-ebs: Creating the AMI: packer-1415574159[0m | |
[0;32m amazon-ebs: AMI: ami-db81eee1[0m | |
[1;32m==> amazon-ebs: Waiting for AMI to become ready...[0m | |
[1;32m==> amazon-ebs: Terminating the source AWS instance...[0m | |
[1;32m==> amazon-ebs: Deleting temporary security group...[0m | |
[1;32mBuild 'amazon-ebs' finished.[0m | |
==> Builds finished. The artifacts of successful builds are: | |
--> amazon-ebs: AMIs were created: | |
ap-southeast-2: ami-db81eee1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment