day1

PROD-18791

Change-Id: I2f47ea12d166676e583323b60d2798f184c8ef9a
diff --git a/day01-image/template.json b/day01-image/template.json
new file mode 100644
index 0000000..adbca4e
--- /dev/null
+++ b/day01-image/template.json
@@ -0,0 +1,127 @@
+{
+  "variables": {
+    "user": "root",
+    "password": "r00tme",
+    "do_api_token": "{{ env `DO_API_TOKEN` }}",
+    "image_name": "{{ env `IMAGE_NAME` }}",
+    "disk_size": "150000"
+
+  },
+  "provisioners": [
+    {
+      "type": "file",
+      "source": "files/root/interfaces",
+      "destination": "/root/interfaces"
+    },
+    {
+      "type": "file",
+      "source": "files/root/minion.conf",
+      "destination": "/root/minion.conf"
+    },
+    {
+      "type": "file",
+      "source": "files/tmp/bootstrap.saltstack.com.sh",
+      "destination": "/tmp/bootstrap.saltstack.com.sh"
+    },
+    {
+      "environment_vars": [
+        "CLUSTER_MODEL={{ user `cluster_model` }}",
+        "CLUSTER_MODEL_REF={{ user `cluster_model_ref` }}",
+        "CLUSTER_NAME={{ user `cluster_name` }}",
+        "FORMULA_VERSION={{ user `formula_version` }}",
+        "UBUNTU_BASEURL={{ user `ubuntu_baseurl` }}",
+        "SALTSTACK_GPG={{ user `saltstack_gpg` }}",
+        "SALTSTACK_REPO={{ user `saltstack_repo` }}",
+        "APT_MIRANTIS_GPG={{ user `apt_mirantis_gpg` }}",
+        "APT_MIRANTIS_SALT_REPO={{ user `apt_mirantis_salt_repo` }}",
+        "GIT_SALT_FORMULAS_SCRIPTS={{ user `git_salt_formulas_scripts` }}",
+        "APT_REPOSITORY={{ user `apt_repository` }}",
+        "APT_REPOSITORY_GPG={{ user `apt_repository_gpg` }}",
+        "APT_MIRANTIS_SALT_REPO={{ user `apt_mirantis_salt_repo` }}"
+      ],
+      "type": "shell",
+      "execute_command": "chmod +x {{ .Path }}; {{ .Vars }} {{ .Path }}",
+      "expect_disconnect": "true",
+      "scripts": [
+        "scripts/base.sh",
+        "scripts/motd.sh",
+        "scripts/network.sh",
+        "scripts/salt_bootstrap.sh",
+        "scripts/salt.sh"
+      ]
+    },
+    {
+      "type": "file",
+      "source": "files/var/maas",
+      "destination": "/var/lib/maas/.maas_login.sh"
+    },
+    {
+      "type": "file",
+      "source": "files/var/jenkins",
+      "destination": "/var/lib/jenkins/org.codefirst.SimpleThemeDecorator.xml"
+    },
+    {
+      "environment_vars": [
+        "HOME=/root",
+        "MCP_VERSION={{ user `mcp_version` }}"
+      ],
+      "type": "shell",
+      "pause_before": "10s",
+      "scripts": [
+        "scripts/security.sh",
+        "scripts/cleanup.sh"
+      ]
+    },
+    {
+      "type": "file",
+      "source": "files/etc/cloud/cloud.cfg.d/99_tcp.cfg",
+      "destination": "/etc/cloud/cloud.cfg.d/99_tcp.cfg"
+    },
+    {
+      "type": "file",
+      "source": "files/etc/cloud/cloud.cfg",
+      "destination": "/etc/cloud/cloud.cfg"
+    }
+  ],
+  "builders": [
+    {
+      "type": "qemu",
+      "qemuargs": [
+        [
+          "-m",
+          "8096M"
+        ],
+        [
+          "-fda",
+          "config-drive/cloudata.iso"
+        ],
+        [
+          "-smp",
+          "4"
+        ]
+      ],
+      "vm_name": "{{ user `image_name` }}-{{ isotime \"200601021504\"  }}",
+      "output_directory": "images/{{ user `image_name`}}",
+      "format": "qcow2",
+      "accelerator": "kvm",
+      "disk_size": "{{ user `disk_size`}}",
+      "iso_url": "http://cloud-images.ubuntu.com/releases/xenial/release-20180306/ubuntu-16.04-server-cloudimg-amd64-disk1.img",
+      "iso_target_path": "/root/isos/xenial-server-cloudimg-amd64-disk1.img",
+      "iso_checksum_type": "md5",
+      "disk_image": true,
+      "iso_checksum": "566efef1d6f12e7d3a994c2405bdb642",
+      "http_directory": "http",
+      "headless": true,
+      "ssh_username": "{{user `user`}}",
+      "ssh_password": "{{user `password`}}",
+      "shutdown_command": "sync; shutdown -P now",
+      "vnc_bind_address": "0.0.0.0",
+      "vnc_port_max": "5956",
+      "vnc_port_min": "5956",
+      "ssh_host_port_min": 2223,
+      "ssh_host_port_max": 2223,
+      "boot_wait": "2s",
+      "ssh_wait_timeout": "360s"
+    }
+  ]
+}