-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathalpine.json
134 lines (134 loc) · 3.93 KB
/
alpine.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
{
"description": "Build base Alpine Linux x86_64",
"variables": {
"vm_name": "alpine-3.10.1-x86_64",
"cpus": "1",
"memory": "2048",
"disk_size": "10240",
"iso_local_url": "iso/alpine-virt-3.10.1-x86_64.iso",
"iso_download_url": "http://dl-cdn.alpinelinux.org/alpine/v3.10/releases/x86_64/alpine-virt-3.10.1-x86_64.iso",
"iso_checksum": "b5cce7d94652e547f07b7dc9e55b1f0b258180b474408e543241be12e0ae255d",
"iso_checksum_type": "sha256",
"root_password": "packer",
"ssh_username": "packer",
"ssh_password": "packer",
"ip_address": "192.168.56.10",
"ip_netmask": "255.255.255.0"
},
"provisioners": [
],
"builders": [
{
"type": "virtualbox-iso",
"headless": false,
"vm_name": "{{user `vm_name`}}",
"format": "ova",
"guest_os_type": "Linux26_64",
"guest_additions_mode": "disable",
"disk_size": "{{user `disk_size`}}",
"iso_urls": [
"{{user `iso_local_url`}}",
"{{user `iso_download_url`}}"
],
"iso_checksum": "{{user `iso_checksum`}}",
"iso_checksum_type": "{{user `iso_checksum_type`}}",
"http_directory": "http",
"communicator": "ssh",
"ssh_username": "{{user `ssh_username`}}",
"ssh_password": "{{user `ssh_password`}}",
"ssh_wait_timeout": "10m",
"shutdown_command": "echo {{user `ssh_password`}} | sudo -S /sbin/poweroff",
"boot_wait": "15s",
"boot_command": [
"root<enter><wait>",
"ifconfig eth0 up && udhcpc -i eth0<enter><wait10>",
"wget http://{{ .HTTPIP }}:{{ .HTTPPort }}/answers<enter><wait>",
"wget http://{{ .HTTPIP }}:{{ .HTTPPort }}/install.sh<enter><wait>",
"chmod +x install.sh<enter><wait>",
"./install.sh {{user `ip_address`}} {{user `ip_netmask`}}<enter><wait>",
"{{user `ssh_username`}}<enter><wait>",
"{{user `ssh_password`}}<enter><wait>",
"<wait10>",
"apk add haveged<enter><wait5>",
"rc-update add haveged<enter><wait>",
"rc-service haveged start<enter><wait>",
"setup-alpine -f $PWD/answers<enter>",
"<wait10>",
"{{user `root_password`}}<enter><wait>",
"{{user `root_password`}}<enter><wait>",
"<wait30>",
"y<enter>",
"<wait60>",
"reboot<enter>",
"<wait20>",
"root<enter><wait>",
"{{user `root_password`}}<enter>",
"<wait5>",
"adduser {{user `ssh_username`}}<enter><wait>",
"{{user `ssh_password`}}<enter><wait>",
"{{user `ssh_password`}}<enter><wait>",
"echo 'Defaults env_keep += \"http_proxy https_proxy\"' > /etc/sudoers.d/wheel<enter><wait>",
"echo '%wheel ALL=(ALL) ALL' >> /etc/sudoers.d/wheel<enter><wait>",
"adduser {{user `ssh_username`}} wheel<enter><wait>",
"reboot<enter>",
"<wait20>",
"root<enter><wait>",
"{{user `root_password`}}<enter><wait>",
"echo '' > /etc/motd<enter><wait>"
],
"hard_drive_interface": "sata",
"vboxmanage": [
[
"modifyvm",
"{{.Name}}",
"--memory",
"{{user `memory`}}"
],
[
"modifyvm",
"{{.Name}}",
"--cpus",
"{{user `cpus`}}"
],
[
"modifyvm",
"{{.Name}}",
"--rtcuseutc",
"on"
],
[
"modifyvm",
"{{.Name}}",
"--nic1",
"nat"
],
[
"modifyvm",
"{{.Name}}",
"--nic2",
"hostonly",
"--hostonlyadapter2",
"VirtualBox Host-Only Ethernet Adapter"
],
[
"modifyvm",
"{{.Name}}",
"--vram",
"16"
],
[
"modifyvm",
"{{.Name}}",
"--nested-hw-virt",
"on"
],
[
"modifyvm",
"{{.Name}}",
"--cpus",
"2"
]
]
}
]
}