Template for ubuntu 16.04
diff --git a/ubuntu-16.04/template.json b/ubuntu-16.04/template.json
new file mode 100644
index 0000000..1c2743b
--- /dev/null
+++ b/ubuntu-16.04/template.json
@@ -0,0 +1,260 @@
+{
+ "variables": {
+ "user": "root",
+ "password": "ho5uo7Uome5d",
+ "do_api_token": "{{ env `DO_API_TOKEN` }}",
+ "distro": "ubuntu-16-04-x64",
+ "disk_size": "8000"
+ },
+
+ "provisioners": [
+ {
+ "type": "shell",
+ "execute_command": "sh '{{.Path}}'",
+ "override": {
+ "virtualbox-iso": {
+ "scripts": [
+ "scripts/base.sh",
+ "scripts/salt.sh",
+ "scripts/vagrant.sh",
+ "scripts/virtualbox.sh",
+ "scripts/security.sh",
+ "scripts/cleanup.sh",
+ "scripts/zerodisk.sh"
+ ]
+ },
+ "vmware-iso": {
+ "scripts": [
+ "scripts/base.sh",
+ "scripts/salt.sh",
+ "scripts/vmware.sh",
+ "scripts/security.sh",
+ "scripts/cleanup.sh",
+ "scripts/zerodisk.sh"
+ ]
+ },
+ "qemu": {
+ "scripts": [
+ "scripts/base.sh",
+ "scripts/salt.sh",
+ "scripts/foreman.sh",
+ "scripts/security.sh",
+ "scripts/cleanup.sh",
+ "scripts/zerodisk.sh"
+ ]
+ },
+ "docker": {
+ "scripts": [
+ "scripts/docker.sh",
+ "scripts/base.sh",
+ "scripts/salt.sh",
+ "scripts/cleanup.sh"
+ ]
+ },
+ "digitalocean": {
+ "scripts": [
+ "scripts/base.sh",
+ "scripts/salt.sh",
+ "scripts/security.sh",
+ "scripts/cleanup.sh"
+ ]
+ }
+ }
+ },
+ {
+ "type": "file",
+ "source": "configs/cloud/cloud.cfg.d/99_tcp.cfg",
+ "destination": "/etc/cloud/cloud.cfg.d/99_tcp.cfg"
+ },
+ {
+ "type": "file",
+ "source": "configs/cloud/cloud.cfg",
+ "destination": "/etc/cloud/cloud.cfg"
+ }
+ ],
+ "post-processors": [
+ {
+ "type": "vagrant",
+ "keep_input_artifact": true,
+ "output": "images/{{ user `distro` }}-{{.Provider}}-{{ timestamp }}.box",
+ "except": [ "digitalocean", "docker" ]
+ },
+ {
+ "type": "docker-tag",
+ "repository": "cloudlab/ubuntu",
+ "tag": "16.04",
+ "only": ["docker"]
+ },
+ {
+ "type": "docker-save",
+ "path": "images/{{ user `distro` }}-docker-{{ timestamp }}.tar",
+ "only": ["docker"]
+ }
+ ],
+ "builders": [
+ {
+ "type": "virtualbox-iso",
+ "boot_command": [
+ "<esc><wait>",
+ "<esc><wait>",
+ "<enter><wait>",
+ "/install/vmlinuz<wait>",
+ " auto<wait>",
+ " console-setup/ask_detect=false<wait>",
+ " console-setup/layoutcode=us<wait>",
+ " console-setup/modelcode=pc105<wait>",
+ " debconf/frontend=noninteractive<wait>",
+ " debian-installer=en_US<wait>",
+ " fb=false<wait>",
+ " initrd=/install/initrd.gz<wait>",
+ " kbd-chooser/method=us<wait>",
+ " keyboard-configuration/layout=USA<wait>",
+ " keyboard-configuration/variant=USA<wait>",
+ " passwd/root-password={{user `password`}} ",
+ " passwd/root-password-again={{user `password`}} ",
+ " locale=en_US<wait>",
+ " netcfg/get_hostname=ubuntu-1604<wait>",
+ " netcfg/get_domain=cloudlab.cz<wait>",
+ " noapic<wait>",
+ " preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg<wait>",
+ " -- <wait>",
+ "<enter><wait>"
+ ],
+ "boot_wait": "5s",
+ "disk_size": "{{ user `disk_size`}}",
+ "output_directory": "images/{{ user `distro` }}-vbox-{{ timestamp }}",
+ "guest_os_type": "Ubuntu_64",
+ "http_directory": "http",
+ "iso_checksum": "8e7b3a1f65db6baeb3e2696d905ea84a",
+ "iso_checksum_type": "md5",
+ "iso_url": "http://cdimage.ubuntu.com/ubuntu-server/daily/current/xenial-server-amd64.iso",
+ "ssh_username": "{{user `user`}}",
+ "ssh_password": "{{user `password`}}",
+ "ssh_port": 22,
+ "ssh_wait_timeout": "10000s",
+ "shutdown_command": "shutdown -P now",
+ "headless": true,
+ "vboxmanage": [
+ [ "modifyvm", "{{.Name}}", "--memory", "1024" ],
+ [ "modifyvm", "{{.Name}}", "--cpus", "2" ],
+ [ "modifyvm", "{{.Name}}", "--vrde", "on" ],
+ [ "modifyvm", "{{.Name}}", "--vrdeport", "5000-5050" ],
+ [ "modifyvm", "{{.Name}}", "--vrdeaddress", "127.0.0.1" ]
+ ]
+ },
+ {
+ "type": "vmware-iso",
+ "boot_command": [
+ "<esc><wait>",
+ "<esc><wait>",
+ "<enter><wait>",
+ "/install/vmlinuz<wait>",
+ " auto<wait>",
+ " console-setup/ask_detect=false<wait>",
+ " console-setup/layoutcode=us<wait>",
+ " console-setup/modelcode=pc105<wait>",
+ " debconf/frontend=noninteractive<wait>",
+ " debian-installer=en_US<wait>",
+ " fb=false<wait>",
+ " initrd=/install/initrd.gz<wait>",
+ " kbd-chooser/method=us<wait>",
+ " keyboard-configuration/layout=USA<wait>",
+ " keyboard-configuration/variant=USA<wait>",
+ " passwd/root-password={{user `password`}} ",
+ " passwd/root-password-again={{user `password`}} ",
+ " locale=en_US<wait>",
+ " netcfg/get_hostname=ubuntu-1604<wait>",
+ " netcfg/get_domain=changeme<wait>",
+ " noapic<wait>",
+ " preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg<wait>",
+ " -- <wait>",
+ "<enter><wait>"
+ ],
+ "boot_wait": "5s",
+ "disk_size": "{{ user `disk_size`}}",
+ "disk_type_id": 4,
+ "vmdk_name": "{{ user `distro`}}",
+ "output_directory": "images/{{ user `distro` }}-vmware-{{ timestamp }}",
+ "guest_os_type": "linux",
+ "http_directory": "http",
+ "iso_checksum": "8e7b3a1f65db6baeb3e2696d905ea84a",
+ "iso_checksum_type": "md5",
+ "iso_url": "http://cdimage.ubuntu.com/ubuntu-server/daily/current/xenial-server-amd64.iso",
+ "ssh_username": "{{user `user`}}",
+ "ssh_password": "{{user `password`}}",
+ "ssh_port": 22,
+ "ssh_wait_timeout": "10000s",
+ "shutdown_command": "shutdown -P now",
+ "vmx_data": {
+ "memsize": "1024",
+ "numvcpus": "1",
+ "cpuid.coresPerSocket": "1"
+ }
+ },
+ {
+ "type": "qemu",
+ "vm_name": "{{ user `distro` }}-{{ timestamp }}",
+ "output_directory": "images/{{ user `distro` }}-qemu-{{ timestamp }}",
+ "format": "qcow2",
+ "accelerator": "kvm",
+ "disk_size": "{{ user `disk_size`}}",
+ "iso_url": "http://cdimage.ubuntu.com/ubuntu-server/daily/current/xenial-server-amd64.iso",
+ "iso_checksum_type": "md5",
+ "iso_checksum": "8e7b3a1f65db6baeb3e2696d905ea84a",
+ "http_directory": "http",
+ "headless": true,
+ "ssh_username": "{{user `user`}}",
+ "ssh_password": "{{user `password`}}",
+ "shutdown_command": "shutdown -P now",
+ "boot_wait": "2s",
+ "ssh_wait_timeout": "10000s",
+ "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<wait>",
+ " auto<wait>",
+ " console-setup/ask_detect=false<wait>",
+ " console-setup/layoutcode=us<wait>",
+ " console-setup/modelcode=pc105<wait>",
+ " debconf/frontend=noninteractive<wait>",
+ " debian-installer=en_US<wait>",
+ " fb=false<wait>",
+ " initrd=/install/initrd.gz<wait>",
+ " kbd-chooser/method=us<wait>",
+ " keyboard-configuration/layout=USA<wait>",
+ " keyboard-configuration/variant=USA<wait>",
+ " passwd/root-password={{user `password`}} ",
+ " passwd/root-password-again={{user `password`}} ",
+ " locale=en_US<wait>",
+ " netcfg/get_hostname=ubuntu-1604<wait>",
+ " netcfg/get_domain=changeme<wait>",
+ " noapic<wait>",
+ " preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg<wait>",
+ " -- <wait>",
+ "<enter><wait>"
+ ]
+ },
+ {
+ "type": "docker",
+ "image": "ubuntu:16.04",
+ "commit": true
+ },
+ {
+ "type": "digitalocean",
+ "api_token": "{{user `do_api_token`}}",
+ "image": "{{user `distro`}}",
+ "snapshot_name": "{{ user `distro` }}-{{ timestamp }}",
+ "region" : "ams2",
+ "size" : "1gb"
+ }
+ ]
+}