-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathpacker-qemu.json
71 lines (62 loc) · 2.25 KB
/
packer-qemu.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
{
"variables": {
"cpu" : "qemu64",
"disk_size" : "6500M",
"disk_image" : "image.dsk",
"iso_checksum" : "",
"iso_url" : "",
"http_directory": ".",
"kickstart" : "",
"memory" : "2048",
"output_dir" : "/dev/shm/qemu",
"password" : "CH$NG3_ME",
"files_path" : "./files"
},
"sensitive-variables": ["password"],
"builders": [
{
"type" : "qemu",
"accelerator" : "kvm",
"boot_command" : [
"<up><wait><tab> text inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/{{ user `kickstart` }}<enter><wait>"
],
"boot_wait" : "10s",
"disk_interface" : "virtio",
"disk_size" : "{{ user `disk_size` }}",
"format" : "raw",
"headless" : "true",
"http_directory" : "{{ user `http_directory` }}",
"iso_checksum" : "{{ user `iso_checksum` }}",
"iso_url" : "{{ user `iso_url` }}",
"memory" : "{{ user `memory` }}",
"net_device" : "virtio-net",
"output_directory" : "{{ user `output_dir` }}",
"qemuargs" : [
["-cpu", "{{ user `cpu` }}"]
],
"shutdown_command" : "shutdown -P now",
"ssh_password" : "{{ user `password` }}",
"ssh_timeout" : "40m",
"ssh_username" : "root",
"vm_name" : "{{ user `disk_image` }}"
}
],
"provisioners": [
{
"type" : "file",
"source" : "{{ user `files_path` }}/",
"destination" : "/tmp"
},
{
"type" : "shell",
"inline" : [
"chmod +x /tmp/run-user-payload /tmp/osg-test.init",
"mv /tmp/run-user-payload /root/run-user-payload",
"mv /tmp/osg-test.init /etc/osg-test.init",
"mv /tmp/osg-test.service /etc/systemd/system/osg-test.service",
"systemctl -q enable osg-test",
":"
]
}
]
}