-
Notifications
You must be signed in to change notification settings - Fork 10
/
alpine.json
115 lines (114 loc) · 3.82 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
{
"builders": [
{
"boot_command": [
"root<enter><wait>",
"ifconfig eth0 up \u0026\u0026 udhcpc -i eth0<enter><wait5>",
"wget http://{{ .HTTPIP }}:{{ .HTTPPort }}/answers<enter><wait>",
"setup-apkrepos -1<enter><wait>",
"setup-alpine -f $PWD/answers<enter><wait>",
"{{user `root_password`}}<enter><wait>",
"{{user `root_password`}}<enter><wait>",
"y<enter>",
"<wait10><wait10>",
"reboot<enter>",
"<wait10><wait10><wait10>",
"root<enter><wait5>",
"{{user `root_password`}}<enter><wait>",
"echo PermitRootLogin yes >> /etc/ssh/sshd_config<enter>",
"/etc/init.d/sshd restart<enter><wait>"
],
"boot_wait": "10s",
"communicator": "ssh",
"disk_size": "{{user `disk_size`}}",
"format": "ova",
"guest_additions_mode": "disable",
"guest_os_type": "Linux26_64",
"headless": false,
"http_directory": "http",
"iso_checksum": "{{user `iso_checksum_type`}}:{{user `iso_checksum`}}",
"iso_urls": [
"{{user `iso_local_url`}}",
"{{user `iso_download_url`}}"
],
"shutdown_command": "/sbin/poweroff",
"ssh_password": "{{user `ssh_password`}}",
"ssh_timeout": "10m",
"ssh_username": "root",
"type": "virtualbox-iso",
"vboxmanage": [
[
"modifyvm",
"{{.Name}}",
"--memory",
"{{user `memory`}}"
],
[
"modifyvm",
"{{.Name}}",
"--cpus",
"{{user `cpus`}}"
],
[
"modifyvm",
"{{.Name}}",
"--rtcuseutc",
"on"
],
[
"modifyvm",
"{{.Name}}",
"--graphicscontroller",
"vmsvga"
],
[
"modifyvm",
"{{.Name}}",
"--vrde",
"off"
]
],
"vm_name": "{{user `vm_name`}}"
}
],
"description": "Build base Alpine Linux x86_64",
"provisioners": [
{
"inline": [
"echo http://dl-cdn.alpinelinux.org/alpine/v3.12/community >> /etc/apk/repositories",
"apk update",
"apk add sudo",
"apk add virtualbox-guest-additions virtualbox-guest-modules-virt",
"echo '%wheel ALL=(ALL) NOPASSWD:ALL' > /etc/sudoers.d/wheel",
"user={{user `ssh_username`}}",
"echo Add user $user with NOPASSWD sudo",
"adduser $user --disabled-password",
"echo '{{user `ssh_username`}}:{{user `ssh_password`}}' | chpasswd",
"adduser $user wheel",
"echo add ssh key",
"cd ~{{user `ssh_username`}}",
"mkdir .ssh",
"chmod 700 .ssh",
"echo {{user `ssh_key`}} > .ssh/authorized_keys",
"chown -R $user .ssh",
"echo disable ssh root login",
"sed '/PermitRootLogin yes/d' -i /etc/ssh/sshd_config"
],
"type": "shell"
}
],
"variables": {
"cpus": "1",
"disk_size": "10240",
"iso_checksum": "fe694a34c0e2d30b9e5dea7e2c1a3892c1f14cb474b69cc5c557a52970071da5",
"iso_checksum_type": "sha256",
"iso_download_url": "http://dl-cdn.alpinelinux.org/alpine/v3.12/releases/x86_64/alpine-virt-3.12.0-x86_64.iso",
"iso_local_url": "../../iso/alpine-virt-3.12.0-x86_64.iso",
"memory": "1024",
"root_password": "vagrant",
"ssh_key": "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzIw+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoPkcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NOTd0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcWyLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQ== vagrant insecure public key",
"ssh_password": "vagrant",
"ssh_username": "vagrant",
"vm_name": "alpine-3.12.0-x86_64"
}
}