forked from stefco/geco_vm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
geco-vm.json
100 lines (89 loc) · 3.05 KB
/
geco-vm.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
{
"variables": {
"scripts": "http",
"home_dir": "home-directory",
"ssh_name": "vagrant",
"ssh_pass": "vagrant",
"hostname": "geco-vm"
},
"builders": [
{
"type": "virtualbox-iso",
"guest_os_type": "Ubuntu_64",
"vboxmanage": [
["modifyvm", "{{.Name}}", "--memory", "512"],
["modifyvm", "{{.Name}}", "--vram", "32"],
["modifyvm", "{{.Name}}", "--cpus", "2"]
],
"disk_size" : 10000,
"iso_url": "http://releases.ubuntu.com/12.04/ubuntu-12.04.5-server-amd64.iso",
"iso_checksum": "769474248a3897f4865817446f9a4a53",
"iso_checksum_type": "md5",
"http_directory" : "{{user `scripts`}}",
"http_port_min" : 9001,
"http_port_max" : 9001,
"ssh_username": "{{user `ssh_name`}}",
"ssh_password": "{{user `ssh_pass`}}",
"ssh_port": 22,
"ssh_wait_timeout": "40m",
"shutdown_command": "echo {{user `ssh_pass`}} | sudo -S shutdown -P now",
"vm_name": "{{user `hostname`}}",
"boot_command" : [
"<esc><esc><enter><wait>",
"/install/vmlinuz noapic ",
"preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg ",
"debian-installer=en_US auto locale=en_US kbd-chooser/method=us ",
"hostname={{user `hostname`}} ",
"fb=false debconf/frontend=noninteractive ",
"keyboard-configuration/modelcode=SKIP keyboard-configuration/layout=USA ",
"keyboard-configuration/variant=USA console-setup/ask_detect=false ",
"initrd=/install/initrd.gz -- <enter>"
]
}
],
"provisioners": [
{
"type": "shell",
"execute_command": "echo '{{user `ssh_pass`}}' | {{.Vars}} sudo -E -S sh '{{.Path}}'",
"scripts": [
"base.sh",
"vagrant.sh",
"virtualbox.sh",
"cleanup.sh",
"zerodisk.sh"
]
},
{
"type": "shell",
"inline": [
"mkdir -p /home/{{user `ssh_name`}}/packer-setup-scripts"
]
},
{
"type": "file",
"source": "{{user `home_dir`}}/",
"destination": "/home/{{user `ssh_name`}}/"
},
{
"type": "file",
"source": "{{user `scripts`}}",
"destination": "/home/{{user `ssh_name`}}/packer-setup-scripts"
}
],
"post-processors": [
[{
"type": "vagrant",
"keep_input_artifact": false
},
{
"type": "atlas",
"only": ["virtualbox-iso"],
"artifact": "stefco/{{user `hostname`}}",
"artifact_type": "vagrant.box",
"metadata": {
"provider": "virtualbox",
"created_at": "{{timestamp}}"
}
}]
]
}