b718171eef8955ff66c134301b0f1b89838adc9b
[packer_vagrant.git] / template.json
1 {
2     "variables": {
3         "atlas_username": "{{env `ATLAS_USERNAME`}}",
4         "atlas_name": "{{env `ATLAS_NAME`}}"
5     },
6     "provisioners": [
7         {
8             "type": "shell",
9             "scripts": [
10                 "scripts/base.sh",
11                 "scripts/virtualbox.sh",
12                 "scripts/vmware.sh",
13                 "scripts/vagrant.sh",
14                 "scripts/dep.sh",
15                 "scripts/cleanup.sh",
16                 "scripts/zerodisk.sh"
17             ],
18             "override": {
19                 "virtualbox-iso": {
20                     "execute_command": "echo 'vagrant'|sudo -S bash '{{.Path}}'"
21                 },
22                 "vmware-iso": {
23                     "execute_command": "echo 'vagrant'|sudo -S bash '{{.Path}}'"
24                 }
25             }
26         }
27     ],
28     "builders": [
29         {
30             "type": "virtualbox-iso",
31             "boot_command": [
32                 "<esc><esc><enter><wait>",
33                 "/install/vmlinuz noapic preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg ",
34                 "debian-installer=en_US auto locale=en_US kbd-chooser/method=us ",
35                 "hostname={{ .Name }} ",
36                 "fb=false debconf/frontend=noninteractive ",
37                 "keyboard-configuration/modelcode=SKIP keyboard-configuration/layout=USA keyboard-configuration/variant=USA console-setup/ask_detect=false ",
38                 "initrd=/install/initrd.gz -- <enter>"
39             ],
40             "headless": true,
41             "boot_wait": "10s",
42             "disk_size": 20480,
43             "guest_os_type": "Ubuntu_64",
44             "http_directory": "http",
45             "iso_checksum": "af224223de99e2a730b67d7785b657f549be0d63221188e105445f75fb8305c9",
46             "iso_checksum_type": "sha256",
47             "iso_url": "http://releases.ubuntu.com/precise/ubuntu-12.04.5-server-amd64.iso",
48             "ssh_username": "vagrant",
49             "ssh_password": "vagrant",
50             "ssh_port": 22,
51             "ssh_wait_timeout": "10000s",
52             "shutdown_command": "echo '/sbin/halt -h -p' > shutdown.sh; echo 'vagrant'|sudo -S bash 'shutdown.sh'",
53             "guest_additions_path": "VBoxGuestAdditions_{{.Version}}.iso",
54             "virtualbox_version_file": ".vbox_version"
55         },
56         {
57             "type": "vmware-iso",
58             "boot_command": [
59                 "<esc><esc><enter><wait>",
60                 "/install/vmlinuz noapic preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg ",
61                 "debian-installer=en_US auto locale=en_US kbd-chooser/method=us ",
62                 "hostname={{ .Name }} ",
63                 "fb=false debconf/frontend=noninteractive ",
64                 "keyboard-configuration/modelcode=SKIP keyboard-configuration/layout=USA keyboard-configuration/variant=USA console-setup/ask_detect=false ",
65                 "initrd=/install/initrd.gz -- <enter>"
66             ],
67             "boot_wait": "10s",
68             "disk_size": 20480,
69             "guest_os_type": "Ubuntu-64",
70             "headless": true,
71             "http_directory": "http",
72             "iso_checksum": "af224223de99e2a730b67d7785b657f549be0d63221188e105445f75fb8305c9",
73             "iso_checksum_type": "sha256",
74             "iso_url": "http://releases.ubuntu.com/precise/ubuntu-12.04.5-server-amd64.iso",
75             "skip_compaction": true,
76             "ssh_username": "vagrant",
77             "ssh_password": "vagrant",
78             "ssh_port": 22,
79             "ssh_wait_timeout": "10000s",
80             "shutdown_command": "echo '/sbin/halt -h -p' > shutdown.sh; echo 'vagrant'|sudo -S bash 'shutdown.sh'",
81             "tools_upload_flavor": "linux"
82         }
83     ],
84     "post-processors": [
85         {
86             "type": "vagrant"
87         },
88         {
89             "type": "atlas",
90             "only": ["vmware-iso"],
91             "artifact": "{{user `atlas_username`}}/{{user `atlas_name`}}",
92             "artifact_type": "vagrant.box",
93             "metadata": {
94                 "provider": "vmware_desktop",
95                 "version": "0.0.1"
96             }
97         },
98         {
99             "type": "atlas",
100             "only": ["virtualbox-iso"],
101             "artifact": "{{user `atlas_username`}}/{{user `atlas_name`}}",
102             "artifact_type": "vagrant.box",
103             "metadata": {
104                 "provider": "virtualbox",
105                 "version": "0.0.1"
106             }
107         }
108     ],
109     "push": {
110         "name": "pearkes/example"
111     }
112 }