forked from nielsabels/packer-xenial64
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtemplate.json
118 lines (118 loc) · 3.58 KB
/
template.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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
{
"variables": {
"name": "krastin/nginx64",
"build_name": "nginx64",
"build_cpu_cores": "2",
"build_memory": "1024",
"cpu_cores": "1",
"memory": "512",
"disk_size": "40960",
"headless": "false",
"iso_checksum": "737ae7041212c628de5751d15c3016058b0e833fdc32e7420209b76ca3d0a535",
"iso_checksum_type": "sha256",
"iso_url": "http://releases.ubuntu.com/16.04.2/ubuntu-16.04.2-server-amd64.iso",
"ssh_username": "vagrant",
"ssh_password": "vagrant"
},
"push": {
"name": "{{user `name`}}",
"exclude": [
".git",
"packer_cache",
"output*-vbox",
"output*-vmware",
"*.box"
]
},
"builders": [
{
"type": "amazon-ebs",
"region": "us-east-1",
"source_ami": "ami-07b4156579ea1d7ba",
"instance_type": "t2.micro",
"ssh_username": "ubuntu",
"ami_name": "nginx64_packer_example_{{timestamp}}",
"tags": {
"OS Version": "Ubuntu",
"Release": "Latest"
}
},
{
"name": "{{ user `build_name` }}-vbox",
"vm_name": "{{ user `build_name` }}-vbox",
"boot_command": [
"<enter><f6><esc><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
"preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg ",
"debian-installer=en_US auto locale=en_US kbd-chooser/method=us ",
"hostname={{ user `build_name` }} ",
"fb=false debconf/fronten=d=noninteractive ",
"keyboard-configuration/modelcode=SKIP keyboard-configuration/layout=USA keyboard-configuration/variant=USA console-setup/ask_detect=false ",
"initrd=/install/initrd.gz -- <enter>"
],
"boot_wait": "5s",
"disk_size": "{{user `disk_size`}}",
"guest_additions_path": "VBoxGuestAdditions_{{.Version}}.iso",
"guest_os_type": "Ubuntu_64",
"headless": "{{user `headless`}}",
"http_directory": "http",
"iso_checksum": "{{user `iso_checksum`}}",
"iso_checksum_type": "{{user `iso_checksum_type`}}",
"iso_url": "{{user `iso_url`}}",
"shutdown_command": "echo 'vagrant' | sudo -S poweroff",
"post_shutdown_delay": "2m",
"ssh_password": "{{user `ssh_username`}}",
"ssh_username": "{{user `ssh_password`}}",
"ssh_wait_timeout": "20m",
"type": "virtualbox-iso",
"vboxmanage": [
[
"modifyvm",
"{{.Name}}",
"--memory",
"{{user `build_memory`}}"
],
[
"modifyvm",
"{{.Name}}",
"--natpf1",
"guest_80,tcp,,8080,,80"
],
[
"modifyvm",
"{{.Name}}",
"--cpus",
"{{user `build_cpu_cores`}}"
]
],
"vboxmanage_post": [
[
"modifyvm",
"{{.Name}}",
"--memory",
"{{user `memory`}}"
],
[
"modifyvm",
"{{.Name}}",
"--cpus",
"{{user `cpu_cores`}}"
]
],
"virtualbox_version_file": ".vbox_version"
}
],
"provisioners": [
{
"execute_command": "echo 'vagrant' | {{.Vars}} sudo -E -S bash '{{.Path}}'",
"script": "scripts/provision.sh",
"type": "shell"
}
],
"post-processors": [
{
"type": "vagrant",
"keep_input_artifact": true,
"output": "{{.BuildName}}.box"
}
]
}