forked from uchida/packer-freebsd
-
Notifications
You must be signed in to change notification settings - Fork 1
/
template.json
149 lines (145 loc) · 4.68 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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
{
"variables": {
"atlas_username": "stblassitude",
"atlas_name": "freebsd",
"version": null,
"iso_url": null,
"iso_checksum": null,
"boot_wait": "30s",
"disk_size": "4096",
"http_directory": "http",
"ssh_username": "root",
"ssh_password": "packer",
"ssh_wait_timeout": "1000s",
"shutdown_command": "shutdown -p now",
"headless": "true",
"HTTP_PROXY": "{{env `HTTP_PROXY`}}",
"freebsd_rel": "11",
"freebsd_version": "11.0"
},
"builders": [
{
"type": "virtualbox-iso",
"guest_os_type": "FreeBSD_64",
"vm_name": "{{user `atlas_name`}}",
"iso_url": "{{user `iso_url`}}",
"iso_checksum": "{{user `iso_checksum`}}",
"boot_command": [
"s<enter><wait>",
"cd /tmp && dhclient em0<enter>",
"fetch http://{{ .HTTPIP }}:{{ .HTTPPort }}/installerconfig && ",
"bsdinstall script /tmp/installerconfig; reboot<enter>"
],
"boot_wait": "{{user `boot_wait`}}",
"disk_size": "{{user `disk_size`}}",
"guest_additions_mode": "disable",
"hard_drive_interface": "sata",
"http_directory": "http",
"ssh_username": "{{user `ssh_username`}}",
"ssh_password": "{{user `ssh_password`}}",
"ssh_wait_timeout": "{{user `ssh_wait_timeout`}}",
"shutdown_command": "{{user `shutdown_command`}}",
"vboxmanage": [
["storagectl", "{{.Name}}", "--name", "SATA Controller", "--hostiocache", "on"]
],
"headless": "{{user `headless`}}"
},
{
"type": "vmware-iso",
"guest_os_type": "freebsd-64",
"vm_name": "{{user `atlas_name`}}",
"iso_url": "{{user `iso_url`}}",
"iso_checksum": "{{user `iso_checksum`}}",
"boot_command": [
"s<enter><wait>",
"cd /tmp && dhclient em0 && ",
"fetch http://{{ .HTTPIP }}:{{ .HTTPPort }}/installerconfig && ",
"bsdinstall script /tmp/installerconfig; reboot<enter>"
],
"boot_wait": "{{user `boot_wait`}}",
"disk_size": "{{user `disk_size`}}",
"http_directory": "http",
"ssh_username": "{{user `ssh_username`}}",
"ssh_password": "{{user `ssh_password`}}",
"ssh_wait_timeout": "{{user `ssh_wait_timeout`}}",
"shutdown_command": "{{user `shutdown_command`}}",
"headless": "{{user `headless`}}"
},
{
"type": "qemu",
"vm_name": "{{user `atlas_name`}}",
"iso_url": "{{user `iso_url`}}",
"iso_checksum": "{{user `iso_checksum`}}",
"boot_command": [
"<enter><wait10><wait10><wait10><wait10>",
"s<enter>",
"cd /tmp && dhclient vtnet0 && ",
"fetch http://{{ .HTTPIP }}:{{ .HTTPPort }}/installerconfig && ",
"bsdinstall script /tmp/installerconfig; reboot<enter>"
],
"boot_wait": "10s",
"disk_size": "{{user `disk_size`}}",
"http_directory": "http",
"ssh_username": "{{user `ssh_username`}}",
"ssh_password": "{{user `ssh_password`}}",
"ssh_wait_timeout": "{{user `ssh_wait_timeout`}}",
"shutdown_command": "{{user `shutdown_command`}}",
"headless": "{{user `headless`}}"
}
],
"provisioners": [
{
"type": "shell",
"scripts": [
"scripts/base.sh",
"scripts/vagrant.sh"
],
"environment_vars": [
"HTTP_PROXY={{user `HTTP_PROXY`}}",
"VAGRANTBOX_NAME=freebsd-{{user `freebsd_rel`}}",
"VAGRANTBOX_URL=https://atlas.hashicorp.com/stblassitude/boxes/freebsd-{{user `freebsd_rel`}}",
"VAGRANTBOX_VERSION={{user `version`}}"
],
"execute_command": "chmod +x {{ .Path }}; /bin/sh -c '{{ .Vars }} {{ .Path }}'"
},
{
"type": "shell",
"script": "scripts/vmguest.sh",
"execute_command": "chmod +x {{ .Path }}; /bin/sh -c '{{ .Vars }} {{ .Path }}'",
"only": [
"virtualbox-iso",
"vmware-iso"
]
},
{
"type": "shell",
"scripts": [
"scripts/cleanup.sh",
"scripts/zerodisk.sh"
],
"execute_command": "chmod +x {{ .Path }}; /bin/sh -c '{{ .Vars }} {{ .Path }}'"
}
],
"post-processors": [
[
{
"type": "vagrant",
"vagrantfile_template": "vagrantfile.template",
"keep_input_artifact": false
},
{
"type": "vagrant-cloud",
"only": [
"virtualbox-iso"
],
"box_tag": "{{user `atlas_username`}}/{{user `atlas_name`}}",
"version": "{{user `version`}}",
"version_description": "FreeBSD {{user `freebsd_version`}} amd64 image with freebsd-update(8) applied as of {{user `date`}}. See https://github.com/stblassitude/packer-freebsd"
}
]
],
"push": {
"name": "{{user `atlas_username`}}/{{user `atlas_name`}}",
"vcs": true
}
}