Skip to content

Instantly share code, notes, and snippets.

@gamename
Created February 20, 2015 19:01
Show Gist options
  • Save gamename/8698b9834f7cfb3be749 to your computer and use it in GitHub Desktop.
Save gamename/8698b9834f7cfb3be749 to your computer and use it in GitHub Desktop.
{
"variables": {
"platform": "dummy_platform",
"os_name": "dummy_os_name",
"built_on": "dummy_built_on",
"out_dir": "dummy_out_dir",
"vagrant_cloud_token": "{{ env `VCLOUD_TOKEN`}}",
"aws_access_key": "{{ env `AWS_ACCESS_KEY_ID` }}",
"aws_secret_key": "{{ env `AWS_SECRET_ACCESS_KEY` }}",
"aws_region": "us-east-1",
"aws_source_ami": "ami-96a818fe",
"aws_instance_type": "m3.medium",
"aws_ssh_timeout": "2m",
"aws_ssh_username": "centos",
"vb_ovf_file": ".",
"vb_ssh_username": "vagrant",
"vb_ssh_password": "vagrant",
"vb_ssh_wait_timeout": "30s",
"vb_shutdown_command": "echo 'vagrant' | sudo -S shutdown -P now",
"vb_guest_additions_mode": "upload",
"vb_headless": "true",
"vb_memory": "1024",
"vb_cpus": "2",
"aws_account_blake": "925719937106",
"aws_account_tennis": "067629317824"
},
"builders": [
{
"type": "amazon-ebs",
"access_key": "{{user `aws_access_key`}}",
"secret_key": "{{user `aws_secret_key`}}",
"region": "{{user `aws_region`}}",
"source_ami": "{{user `aws_source_ami`}}",
"instance_type": "{{user `aws_instance_type`}}",
"ssh_timeout": "{{user `aws_ssh_timeout`}}",
"ssh_username": "{{user `aws_ssh_username`}}",
"temporary_key_pair_name": "ngd-packer-{{user `built_on` }}",
"ami_name": "ngd-{{user `os_name` }}-{{user `built_on` }}",
"launch_block_device_mappings": [
{
"device_name": "/dev/sda1",
"delete_on_termination": true
}
],
"ami_users": [
"{{ user `aws_account_blake`}}",
"{{ user `aws_account_tennis`}}"
],
"ami_regions": [ "us-west-2" ]
},
{
"type": "virtualbox-ovf",
"source_path": "{{user `vb_ovf_file`}}",
"ssh_username": "{{user `vb_ssh_username`}}",
"ssh_password": "{{user `vb_ssh_password`}}",
"ssh_wait_timeout": "{{user `vb_ssh_wait_timeout`}}",
"shutdown_command": "{{user `vb_shutdown_command`}}",
"headless": "{{user `vb_headless`}}",
"guest_additions_mode": "{{user `vb_guest_additions_mode`}}",
"guest_additions_path": "VBoxGuestAdditions_{{.Version}}.iso",
"virtualbox_version_file": ".vbox_version",
"vboxmanage": [
[ "modifyvm", "{{.Name}}", "--memory", "{{user `vb_memory`}}" ],
[ "modifyvm", "{{.Name}}", "--cpus", "{{user `vb_cpus`}}" ]
]
}
],
"provisioners": [
{
"type": "file",
"source": "rsync",
"destination": "/tmp/rsync"
},
{
"type": "file",
"source": "cloud-init",
"destination": "/tmp/cloud-init"
},
{
"type": "shell",
"execute_command": "echo 'vagrant'|{{.Vars}} sudo -S -E bash '{{.Path}}'",
"environment_vars": [
"ID={{user `platform`}}",
"DEBIAN_FRONTEND=noninteractive",
"PACKER_BUILD_DATE_TIME={{ user `built_on`}}"
],
"scripts": [
"scripts/update.sh",
"scripts/audit.sh",
"scripts/userhack.sh",
"scripts/shellhack.sh",
"scripts/motd.sh",
"scripts/cloudhack.sh",
"scripts/rsync.sh",
"scripts/cleanup.sh"
]
},
{
"type": "shell",
"execute_command": "echo 'vagrant'|{{.Vars}} sudo -S -E bash '{{.Path}}'",
"scripts": [
"scripts/virtualbox.sh",
"scripts/vagranthack.sh"
],
"only": ["virtualbox-ovf"]
}
],
"post-processors": [
{
"type": "vagrant",
"vagrantfile_template": "vagrantfiles/template.rb",
"override": {
"virtualbox": {
"output":
"{{user `out_dir`}}/vb/{{user `os_name`}}.box"
},
"aws": {
"output":
"{{user `out_dir`}}/aws/{{user `os_name`}}.box"
}
}
},
{
"type": "atlas",
"artifact": "nextgxdx/tns-centos-70",
"artifact_type": "virtualbox",
"metadata": {
"created_at": "{{user `built_on`}}"
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment