-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpacker-hyperv.json
74 lines (74 loc) · 2.54 KB
/
packer-hyperv.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
{
"variables": {
"assets_root": "{{env `ASSETS_URL`}}",
"ssh_user": "{{env `PACKER_SSH_USER`}}",
"ssh_pass": "{{env `PACKER_SSH_PASS`}}"
},
"builders": [
{
"type": "hyperv-iso",
"boot_wait": "5s",
"ram_size": 4096,
"cpu": 2,
"guest_additions_mode": "disable",
"generation": 1,
"enable_secure_boot": false,
"http_directory": "preseed",
"boot_command": [
"<enter><wait>",
"<f6><esc>",
"<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
"<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
"<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
"<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
"<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
"<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
"<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
"<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
"<bs><bs><bs>",
"/install/vmlinuz ",
"initrd=/install/initrd.gz ",
"netcfg/choose_interface=eth0 ",
"net.ifnames=0 ",
"auto-install/enable=true ",
"debconf/priority=critical ",
"debian-installer/allow_unauthenticated_ssl=true ",
"preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/training.cfg ",
"<enter>"
],
"disk_size": 16384,
"iso_urls": [
"http://releases.ubuntu.com/16.04.4/ubuntu-16.04.4-server-amd64.iso"
],
"iso_checksum_type": "sha256",
"iso_checksum": "0a03608988cfd2e50567990dc8be96fb3c501e198e2e6efcb846d89efc7b89f2",
"ssh_username": "{{user `ssh_user`}}",
"ssh_password": "{{user `ssh_pass`}}",
"ssh_port": 22,
"ssh_timeout": "10m",
"shutdown_command": "echo '{{user `password`}}'|sudo -S /sbin/halt -h -p",
"vm_name": "kensu-training",
"output_directory": "hyperv-image"
}],
"provisioners": [{
"type": "shell",
"execute_command": "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'",
"inline": [
"mkdir /srv/tmp",
"chmod 777 /srv/tmp"
],
"inline_shebang": "/bin/sh -x",
"skip_clean": true
},
{
"type": "file",
"source": "ansible_install",
"destination": "/srv/tmp"
},
{
"type": "shell",
"execute_command": "echo '{{user `ssh_pass`}}' | sudo -E -S sh '{{ .Path }}'",
"script": "bootstrap.sh",
"skip_clean": true
}]
}