Filip Pytloun | ac2be79 | 2016-01-08 12:09:49 +0100 | [diff] [blame] | 1 | { |
| 2 | "variables": { |
| 3 | "user": "root", |
| 4 | "password": "ho5uo7Uome5d", |
Jiri Broulik | 0b21167 | 2018-04-11 09:35:47 +0200 | [diff] [blame] | 5 | "do_api_token": "{{ env `DO_API_TOKEN` }}", |
| 6 | "distro": "debian-8-x64", |
| 7 | "image_name": "{{ env `IMAGE_NAME` }}", |
Filip Pytloun | ac2be79 | 2016-01-08 12:09:49 +0100 | [diff] [blame] | 8 | "disk_size": "8000" |
| 9 | }, |
| 10 | |
| 11 | "provisioners": [ |
| 12 | { |
| 13 | "type": "shell", |
Filip Pytloun | e7dce99 | 2016-01-08 12:52:57 +0100 | [diff] [blame] | 14 | "execute_command": "sh '{{.Path}}'", |
Filip Pytloun | ac2be79 | 2016-01-08 12:09:49 +0100 | [diff] [blame] | 15 | "override": { |
| 16 | "virtualbox-iso": { |
| 17 | "scripts": [ |
| 18 | "scripts/base.sh", |
| 19 | "scripts/salt.sh", |
| 20 | "scripts/vagrant.sh", |
| 21 | "scripts/virtualbox.sh", |
| 22 | "scripts/security.sh", |
| 23 | "scripts/cleanup.sh", |
| 24 | "scripts/zerodisk.sh" |
| 25 | ] |
| 26 | }, |
| 27 | "vmware-iso": { |
| 28 | "scripts": [ |
| 29 | "scripts/base.sh", |
| 30 | "scripts/salt.sh", |
| 31 | "scripts/vmware.sh", |
| 32 | "scripts/security.sh", |
| 33 | "scripts/cleanup.sh", |
| 34 | "scripts/zerodisk.sh" |
| 35 | ] |
| 36 | }, |
| 37 | "qemu": { |
| 38 | "scripts": [ |
| 39 | "scripts/base.sh", |
| 40 | "scripts/salt.sh", |
Filip Pytloun | ac2be79 | 2016-01-08 12:09:49 +0100 | [diff] [blame] | 41 | "scripts/security.sh", |
| 42 | "scripts/cleanup.sh", |
| 43 | "scripts/zerodisk.sh" |
| 44 | ] |
| 45 | }, |
| 46 | "docker": { |
| 47 | "scripts": [ |
| 48 | "scripts/docker.sh", |
| 49 | "scripts/base.sh", |
| 50 | "scripts/salt.sh", |
| 51 | "scripts/cleanup.sh" |
| 52 | ] |
| 53 | }, |
| 54 | "digitalocean": { |
| 55 | "scripts": [ |
| 56 | "scripts/base.sh", |
| 57 | "scripts/salt.sh", |
| 58 | "scripts/security.sh", |
| 59 | "scripts/cleanup.sh" |
| 60 | ] |
| 61 | } |
| 62 | } |
| 63 | }, |
| 64 | { |
| 65 | "type": "file", |
| 66 | "source": "configs/cloud/cloud.cfg.d/99_tcp.cfg", |
| 67 | "destination": "/etc/cloud/cloud.cfg.d/99_tcp.cfg" |
| 68 | }, |
| 69 | { |
| 70 | "type": "file", |
| 71 | "source": "configs/cloud/cloud.cfg", |
| 72 | "destination": "/etc/cloud/cloud.cfg" |
| 73 | } |
| 74 | ], |
| 75 | "post-processors": [ |
| 76 | { |
| 77 | "type": "vagrant", |
| 78 | "keep_input_artifact": true, |
Jiri Broulik | 0b21167 | 2018-04-11 09:35:47 +0200 | [diff] [blame] | 79 | "output": "images/{{ user `image_name` }}-{{.Provider}}-{{ isotime \"200601021504\" }}.box", |
Filip Pytloun | ac2be79 | 2016-01-08 12:09:49 +0100 | [diff] [blame] | 80 | "except": [ "digitalocean", "docker" ] |
| 81 | }, |
| 82 | { |
| 83 | "type": "docker-tag", |
Filip Pytloun | c2b0ca0 | 2016-06-09 16:26:30 +0200 | [diff] [blame] | 84 | "repository": "tcpcloud/debian", |
Filip Pytloun | ac2be79 | 2016-01-08 12:09:49 +0100 | [diff] [blame] | 85 | "tag": "8", |
| 86 | "only": ["docker"] |
| 87 | }, |
| 88 | { |
| 89 | "type": "docker-save", |
Jiri Broulik | 0b21167 | 2018-04-11 09:35:47 +0200 | [diff] [blame] | 90 | "path": "images/{{ user `image_name` }}-docker-{{ isotime \"200601021504\" }}.tar", |
Filip Pytloun | ac2be79 | 2016-01-08 12:09:49 +0100 | [diff] [blame] | 91 | "only": ["docker"] |
| 92 | } |
| 93 | ], |
| 94 | "builders": [ |
| 95 | { |
| 96 | "type": "virtualbox-iso", |
| 97 | "boot_command": [ |
| 98 | "<esc><wait>", |
| 99 | "install<wait>", |
| 100 | " preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg<wait>", |
| 101 | " debian-installer=en_US<wait>", |
| 102 | " auto<wait>", |
| 103 | " locale=en_US<wait>", |
| 104 | " console-setup/ask_detect=false<wait>", |
| 105 | " console-setup/layoutcode=us<wait>", |
| 106 | " console-setup/modelcode=pc105<wait>", |
| 107 | " debconf/frontend=noninteractive<wait>", |
| 108 | " fb=false<wait>", |
| 109 | " initrd=/install/initrd.gz<wait>", |
| 110 | " kbd-chooser/method=us<wait>", |
| 111 | " keyboard-configuration/xkb-keymap=us <wait>", |
| 112 | " passwd/root-password={{user `password`}} ", |
| 113 | " passwd/root-password-again={{user `password`}} ", |
| 114 | " netcfg/get_hostname=debian-8<wait>", |
| 115 | " netcfg/get_domain=cloudlab.cz<wait>", |
| 116 | " noapic<wait>", |
| 117 | "<enter><wait>" |
| 118 | ], |
| 119 | "boot_wait": "5s", |
| 120 | "disk_size": "{{ user `disk_size`}}", |
Filip Pytloun | 451bc98 | 2017-03-13 16:21:24 +0100 | [diff] [blame] | 121 | "output_directory": "images/{{ user `distro` }}-vbox-{{ isotime \"200601021504\" }}", |
Filip Pytloun | ac2be79 | 2016-01-08 12:09:49 +0100 | [diff] [blame] | 122 | "guest_os_type": "Debian_64", |
| 123 | "http_directory": "http", |
Filip Pytloun | 8549f1f | 2017-03-08 15:16:55 +0100 | [diff] [blame] | 124 | "iso_checksum": "453312bf56fc45669fec5ebc0f025ac7", |
Filip Pytloun | ac2be79 | 2016-01-08 12:09:49 +0100 | [diff] [blame] | 125 | "iso_checksum_type": "md5", |
Filip Pytloun | 8549f1f | 2017-03-08 15:16:55 +0100 | [diff] [blame] | 126 | "iso_url": "http://cdimage.debian.org/debian-cd/8.7.1/amd64/iso-cd/debian-8.7.1-amd64-netinst.iso", |
Filip Pytloun | ac2be79 | 2016-01-08 12:09:49 +0100 | [diff] [blame] | 127 | "ssh_username": "{{user `user`}}", |
| 128 | "ssh_password": "{{user `password`}}", |
| 129 | "ssh_port": 22, |
| 130 | "ssh_wait_timeout": "10000s", |
Filip Pytloun | e7dce99 | 2016-01-08 12:52:57 +0100 | [diff] [blame] | 131 | "shutdown_command": "shutdown -P now", |
Filip Pytloun | ac2be79 | 2016-01-08 12:09:49 +0100 | [diff] [blame] | 132 | "headless": true, |
| 133 | "vboxmanage": [ |
| 134 | [ "modifyvm", "{{.Name}}", "--memory", "1024" ], |
| 135 | [ "modifyvm", "{{.Name}}", "--cpus", "2" ], |
| 136 | [ "modifyvm", "{{.Name}}", "--vrde", "on" ], |
| 137 | [ "modifyvm", "{{.Name}}", "--vrdeport", "5000-5050" ], |
| 138 | [ "modifyvm", "{{.Name}}", "--vrdeaddress", "127.0.0.1" ] |
| 139 | ] |
| 140 | }, |
| 141 | { |
| 142 | "type": "vmware-iso", |
| 143 | "boot_command": [ |
| 144 | "<esc><wait>", |
| 145 | "install<wait>", |
| 146 | " preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg<wait>", |
| 147 | " debian-installer=en_US<wait>", |
| 148 | " auto<wait>", |
| 149 | " locale=en_US<wait>", |
| 150 | " console-setup/ask_detect=false<wait>", |
| 151 | " console-setup/layoutcode=us<wait>", |
| 152 | " console-setup/modelcode=pc105<wait>", |
| 153 | " debconf/frontend=noninteractive<wait>", |
| 154 | " fb=false<wait>", |
| 155 | " initrd=/install/initrd.gz<wait>", |
| 156 | " kbd-chooser/method=us<wait>", |
| 157 | " keyboard-configuration/xkb-keymap=us <wait>", |
| 158 | " passwd/root-password={{user `password`}} ", |
| 159 | " passwd/root-password-again={{user `password`}} ", |
| 160 | " netcfg/get_hostname=debian-8<wait>", |
| 161 | " netcfg/get_domain=cloudlab.cz<wait>", |
| 162 | " noapic<wait>", |
| 163 | "<enter><wait>" |
| 164 | ], |
| 165 | "boot_wait": "5s", |
| 166 | "disk_size": "{{ user `disk_size`}}", |
| 167 | "disk_type_id": 4, |
Jiri Broulik | 0b21167 | 2018-04-11 09:35:47 +0200 | [diff] [blame] | 168 | "vmdk_name": "{{ user `image_name`}}", |
Filip Pytloun | 451bc98 | 2017-03-13 16:21:24 +0100 | [diff] [blame] | 169 | "output_directory": "images/{{ user `distro` }}-vmware-{{ isotime \"200601021504\" }}", |
Filip Pytloun | ac2be79 | 2016-01-08 12:09:49 +0100 | [diff] [blame] | 170 | "guest_os_type": "linux", |
| 171 | "http_directory": "http", |
Filip Pytloun | 8549f1f | 2017-03-08 15:16:55 +0100 | [diff] [blame] | 172 | "iso_checksum": "453312bf56fc45669fec5ebc0f025ac7", |
Filip Pytloun | ac2be79 | 2016-01-08 12:09:49 +0100 | [diff] [blame] | 173 | "iso_checksum_type": "md5", |
Filip Pytloun | 8549f1f | 2017-03-08 15:16:55 +0100 | [diff] [blame] | 174 | "iso_url": "http://cdimage.debian.org/debian-cd/8.7.1/amd64/iso-cd/debian-8.7.1-amd64-netinst.iso", |
Filip Pytloun | ac2be79 | 2016-01-08 12:09:49 +0100 | [diff] [blame] | 175 | "ssh_username": "{{user `user`}}", |
| 176 | "ssh_password": "{{user `password`}}", |
| 177 | "ssh_port": 22, |
| 178 | "ssh_wait_timeout": "10000s", |
Filip Pytloun | e7dce99 | 2016-01-08 12:52:57 +0100 | [diff] [blame] | 179 | "shutdown_command": "shutdown -P now", |
Filip Pytloun | ac2be79 | 2016-01-08 12:09:49 +0100 | [diff] [blame] | 180 | "vmx_data": { |
| 181 | "memsize": "1024", |
| 182 | "numvcpus": "1", |
| 183 | "cpuid.coresPerSocket": "1" |
| 184 | } |
| 185 | }, |
| 186 | { |
| 187 | "type": "qemu", |
Filip Pytloun | 56cf9e3 | 2016-02-19 09:56:08 +0100 | [diff] [blame] | 188 | "qemuargs": [ |
| 189 | [ "-m", "1024M" ] |
| 190 | ], |
Jiri Broulik | 0b21167 | 2018-04-11 09:35:47 +0200 | [diff] [blame] | 191 | "vm_name": "{{ user `image_name` }}-{{ isotime \"200601021504\" }}", |
Filip Pytloun | 451bc98 | 2017-03-13 16:21:24 +0100 | [diff] [blame] | 192 | "output_directory": "images/{{ user `distro` }}-qemu-{{ isotime \"200601021504\" }}", |
Filip Pytloun | ac2be79 | 2016-01-08 12:09:49 +0100 | [diff] [blame] | 193 | "format": "qcow2", |
| 194 | "accelerator": "kvm", |
| 195 | "disk_size": "{{ user `disk_size`}}", |
Filip Pytloun | 8549f1f | 2017-03-08 15:16:55 +0100 | [diff] [blame] | 196 | "iso_url": "http://cdimage.debian.org/debian-cd/8.7.1/amd64/iso-cd/debian-8.7.1-amd64-netinst.iso", |
Filip Pytloun | ac2be79 | 2016-01-08 12:09:49 +0100 | [diff] [blame] | 197 | "iso_checksum_type": "md5", |
Filip Pytloun | 8549f1f | 2017-03-08 15:16:55 +0100 | [diff] [blame] | 198 | "iso_checksum": "453312bf56fc45669fec5ebc0f025ac7", |
Filip Pytloun | ac2be79 | 2016-01-08 12:09:49 +0100 | [diff] [blame] | 199 | "http_directory": "http", |
| 200 | "headless": true, |
| 201 | "ssh_username": "{{user `user`}}", |
| 202 | "ssh_password": "{{user `password`}}", |
Filip Pytloun | e7dce99 | 2016-01-08 12:52:57 +0100 | [diff] [blame] | 203 | "shutdown_command": "shutdown -P now", |
Filip Pytloun | ac2be79 | 2016-01-08 12:09:49 +0100 | [diff] [blame] | 204 | "boot_wait": "2s", |
| 205 | "ssh_wait_timeout": "10000s", |
| 206 | "boot_command": [ |
| 207 | "<esc><wait>", |
| 208 | "install<wait>", |
| 209 | " preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg<wait>", |
| 210 | " debian-installer=en_US<wait>", |
| 211 | " auto<wait>", |
| 212 | " locale=en_US<wait>", |
| 213 | " console-setup/ask_detect=false<wait>", |
| 214 | " console-setup/layoutcode=us<wait>", |
| 215 | " console-setup/modelcode=pc105<wait>", |
| 216 | " debconf/frontend=noninteractive<wait>", |
| 217 | " fb=false<wait>", |
| 218 | " initrd=/install/initrd.gz<wait>", |
| 219 | " kbd-chooser/method=us<wait>", |
| 220 | " keyboard-configuration/xkb-keymap=us <wait>", |
| 221 | " passwd/root-password={{user `password`}} ", |
| 222 | " passwd/root-password-again={{user `password`}} ", |
| 223 | " netcfg/get_hostname=debian-8<wait>", |
| 224 | " netcfg/get_domain=cloudlab.cz<wait>", |
| 225 | " noapic<wait>", |
| 226 | "<enter><wait>" |
| 227 | ] |
| 228 | }, |
| 229 | { |
| 230 | "type": "docker", |
| 231 | "image": "debian:8", |
| 232 | "commit": true |
| 233 | }, |
| 234 | { |
| 235 | "type": "digitalocean", |
| 236 | "api_token": "{{user `do_api_token`}}", |
Jiri Broulik | 0b21167 | 2018-04-11 09:35:47 +0200 | [diff] [blame] | 237 | "image": "{{user `image_name`}}", |
| 238 | "snapshot_name": "{{ user `image_name` }}-{{ isotime \"200601021504\" }}", |
Filip Pytloun | ac2be79 | 2016-01-08 12:09:49 +0100 | [diff] [blame] | 239 | "region" : "ams2", |
| 240 | "size" : "1gb" |
| 241 | } |
| 242 | ] |
| 243 | } |