-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathkvm-host.json
More file actions
55 lines (51 loc) · 1.58 KB
/
kvm-host.json
File metadata and controls
55 lines (51 loc) · 1.58 KB
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
{
"variables": {
"disk_size": "1G",
"build_dir": "build"
},
"builders": [
{
"type": "qemu",
"disk_image": true,
"iso_url": "{{user `build_dir`}}/alpine-usb.img",
"iso_checksum_type": "none",
"headless": true,
"memory": 1024,
"disk_size": "{{user `disk_size`}}",
"format": "raw",
"ssh_username": "root",
"ssh_private_key_file": "files/packer_key",
"qemuargs": [
["-device", "qemu-xhci,id=xhci"],
["-device", "usb-storage,bus=xhci.0,drive=stick"],
["-drive", "file=output-qemu/packer-qemu,if=none,id=stick,format=raw"]
]
}
],
"provisioners": [
{
"type": "shell",
"inline": [
"echo 'https://mirror.yandex.ru/mirrors/alpine/v3.11/main' >> /etc/apk/repositories",
"echo 'https://mirror.yandex.ru/mirrors/alpine/v3.11/community' >> /etc/apk/repositories",
"apk update",
"apk add bridge libvirt-daemon qemu-img qemu-system-x86_64",
"rc-update add libvirtd",
"lbu commit || true"
]
},
{
"type": "inspec",
"profile": "spec/alpine-usb.rb"
}
],
"post-processors": [
{
"type": "shell-local",
"inline": [
"mv output-qemu/packer-qemu {{user `build_dir`}}/kvm-host.img",
"rm -r output-qemu"
]
}
]
}