-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathubuntu.json
108 lines (108 loc) · 3.06 KB
/
ubuntu.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
{
"variables": {
"iso": "/tmp/ubuntu-14.04.4-server-amd64.iso",
"iso_md5": "2ac1f3e0de626e54d05065d6f549fa3a",
"preseed": "config/custom.seed",
"gpg_pubring": "/tmp/.gnupg/pubring.gpg",
"gpg_secring": "/tmp/.gnupg/secring.gpg",
"gpg_uid": "Mirantis",
"deb_packages": "python-pip docker-engine ansible nginx git mc",
"py_packages": "docker-py==1.10.2",
"dst_iso": "/tmp/image.iso"
},
"builders": [
{
"type": "qemu",
"qemuargs": [
[ "-m", "2048M" ],
[ "-netdev", "user,hostfwd=tcp::{{ .SSHHostPort }}-:22,id=forward"],
[ "-device", "virtio-net,netdev=forward,id=net0"]
],
"boot_command": [
"<esc><wait>",
"<esc><wait>",
"<enter><wait>",
"/install/vmlinuz",
" auto",
" console-setup/ask_detect=false",
" console-setup/layoutcode=us",
" console-setup/modelcode=pc105",
" debconf/frontend=noninteractive",
" debian-installer=en_US",
" fb=false",
" initrd=/install/initrd.gz",
" kbd-chooser/method=us",
" keyboard-configuration/layout=USA",
" keyboard-configuration/variant=USA",
" locale=en_US",
" netcfg/get_hostname=base",
" netcfg/get_domain=mirantis.local",
" netcfg/choose_interface=eth0",
" noapic",
" preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg",
" -- ",
"<enter><wait>"
],
"boot_wait": "10s",
"disk_size": 40960,
"format": "qcow2",
"http_directory": "http",
"headless": "true",
"iso_checksum": "{{user `iso_md5`}}",
"iso_checksum_type": "md5",
"iso_url": "file://{{user `iso`}}",
"ssh_username": "mirantis",
"ssh_password": "mirantis",
"ssh_port": 22,
"ssh_wait_timeout": "10000s",
"shutdown_command": "echo 'shutdown -P now' > /tmp/shutdown.sh; echo 'mirantis'|sudo -S sh '/tmp/shutdown.sh'",
"vm_name": "base"
}
],
"provisioners": [
{
"type": "file",
"source": "config",
"destination": "/home/mirantis"
},
{
"type": "file",
"source": "{{user `preseed`}}",
"destination": "/home/mirantis/preseed.cfg"
},
{
"type": "shell",
"inline": [
"mkdir -m 700 /home/mirantis/.gnupg"
]
},
{
"type": "file",
"source": "{{user `gpg_pubring`}}",
"destination": "/home/mirantis/.gnupg/pubring.gpg"
},
{
"type": "file",
"source": "{{user `gpg_secring`}}",
"destination": "/home/mirantis/.gnupg/secring.gpg"
},
{
"type": "shell",
"execute_command": "echo 'mirantis' | {{ .Vars }} sudo -ES bash '{{ .Path }}'",
"environment_vars": [
"GPG_UID={{user `gpg_uid`}}",
"DEB_PACKAGES={{user `deb_packages`}}",
"PY_PACKAGES={{user `py_packages`}}"
],
"scripts": [
"scripts/image.sh"
]
},
{
"type": "file",
"source": "/home/mirantis/image.iso",
"destination": "{{user `dst_iso`}}",
"direction": "download"
}
]
}