forked from AntonioMeireles/ClearLinux-packer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
packer.conf.virtualbox.json
75 lines (75 loc) · 1.94 KB
/
packer.conf.virtualbox.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
{
"variables": {
"cloud_token": "{{ env `VAGRANT_CLOUD_TOKEN` }}",
"version": "{{ env `VERSION` }}",
"name": "{{ env `BOX_NAME` }}",
"box_tag": "{{ env `REPOSITORY` }}"
},
"builders": [
{
"type": "virtualbox-ovf",
"source_path": "media/clear-{{user `version`}}-virtualbox-factory/ClearLinux-{{user `version`}}.ova",
"checksum_type": "none",
"boot_wait": "20s",
"ssh_username": "clear",
"ssh_password": "V@grant!",
"output_directory": "boxes/tmp",
"ssh_port": 22,
"ssh_wait_timeout": "5m",
"vm_name": "{{ user `name` }}",
"shutdown_command": "cat /dev/zero > zero.fill; sync; sleep 5; sync; rm -f zero.fill; sudo shutdown -P now",
"guest_additions_mode": "upload",
"vboxmanage": [
[ "modifyvm", "{{.Name}}", "--memory", "2048" ],
[ "modifyvm", "{{.Name}}", "--ostype", "Linux26_64" ],
[ "modifyvm", "{{.Name}}", "--cpus", "2" ],
[ "modifyvm", "{{.Name}}", "--chipset", "ich9" ],
[ "modifyvm", "{{.Name}}", "--firmware", "efi" ],
[ "modifyvm", "{{.Name}}", "--paravirtprovider", "kvm" ],
[ "modifyvm", "{{.Name}}", "--rtcuseutc", "on" ],
[ "modifyvm", "{{.Name}}", "--boot1", "disk" ]
]
}
],
"provisioners": [
{
"type": "shell",
"inline": [
"sudo timedatectl set-ntp true"
],
"pause_before": "5s"
}, {
"type": "shell",
"script": "vboxguestsetup.sh",
"execute_command": "sudo bash {{.Path}}",
"pause_before": "5s"
}, {
"type": "shell",
"expect_disconnect": true,
"start_retry_timeout": "600s",
"inline": [
"echo 'rebooting...'",
"sudo reboot"
]
}, {
"type": "shell",
"inline": [
"uname -a; swupd info"
],
"pause_before": "5s"
}
],
"post-processors": [
[
{
"type": "vagrant",
"output": "boxes/{{ .Provider }}/{{user `name` }}-{{ user `version`}}.{{ .Provider }}.box",
"compression_level": 9,
"vagrantfile_template": "Vagrantfile.template.rb",
"include": [
"info.json"
]
}
]
]
}