Update ubuntu scripts

  * Use mirrors proto for upstream repos
  * Fix and extend motd
    - motd was in wrong format(base.sh)
      that propagate error messages at boot
  * make template json-pretty

Change-Id: I71f41240fa987ff11a605cc9237e4482794053cd
diff --git a/ubuntu-14.04/template.json b/ubuntu-14.04/template.json
index f8fcf6a..13d878c 100644
--- a/ubuntu-14.04/template.json
+++ b/ubuntu-14.04/template.json
@@ -1,12 +1,11 @@
 {
-   "variables": {
-        "user": "root",
-        "password": "ho5uo7Uome5d",
-	"do_api_token": "{{ env `DO_API_TOKEN` }}",
-	"distro": "ubuntu-14-04-x64",
-        "disk_size": "8000"
-   },
-
+  "variables": {
+    "user": "root",
+    "password": "ho5uo7Uome5d",
+    "do_api_token": "{{ env `DO_API_TOKEN` }}",
+    "distro": "ubuntu-14-04-x64",
+    "disk_size": "8000"
+  },
   "provisioners": [
     {
       "type": "shell",
@@ -15,7 +14,7 @@
         "virtualbox-iso": {
           "scripts": [
             "scripts/base.sh",
-	    "scripts/salt.sh",
+            "scripts/salt.sh",
             "scripts/vagrant.sh",
             "scripts/virtualbox.sh",
             "scripts/security.sh",
@@ -33,31 +32,31 @@
             "scripts/zerodisk.sh"
           ]
         },
-	"qemu": {
+        "qemu": {
           "scripts": [
             "scripts/base.sh",
-	    "scripts/salt.sh",
+            "scripts/salt.sh",
             "scripts/security.sh",
             "scripts/cleanup.sh",
             "scripts/zerodisk.sh"
           ]
-	},
-	"docker": {
+        },
+        "docker": {
           "scripts": [
             "scripts/docker.sh",
             "scripts/base.sh",
-	    "scripts/salt.sh",
+            "scripts/salt.sh",
             "scripts/cleanup.sh"
           ]
-	},
-	"digitalocean": {
-	  "scripts": [
-	    "scripts/base.sh",
-	    "scripts/salt.sh",
+        },
+        "digitalocean": {
+          "scripts": [
+            "scripts/base.sh",
+            "scripts/salt.sh",
             "scripts/security.sh",
-	    "scripts/cleanup.sh"
-	  ]
-	}
+            "scripts/cleanup.sh"
+          ]
+        }
       }
     },
     {
@@ -76,18 +75,25 @@
       "type": "vagrant",
       "keep_input_artifact": true,
       "output": "images/{{ user `distro` }}-{{.Provider}}-{{ isotime \"200601021504\" }}.box",
-      "except": [ "digitalocean", "docker" ]
+      "except": [
+        "digitalocean",
+        "docker"
+      ]
     },
     {
       "type": "docker-tag",
       "repository": "tcpcloud/ubuntu",
       "tag": "14.04",
-      "only": ["docker"]
+      "only": [
+        "docker"
+      ]
     },
     {
       "type": "docker-save",
       "path": "images/{{ user `distro` }}-docker-{{ isotime \"200601021504\" }}.tar",
-      "only": ["docker"]
+      "only": [
+        "docker"
+      ]
     }
   ],
   "builders": [
@@ -134,11 +140,36 @@
       "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" ]
+        [
+          "modifyvm",
+          "{{.Name}}",
+          "--memory",
+          "1024"
+        ],
+        [
+          "modifyvm",
+          "{{.Name}}",
+          "--cpus",
+          "2"
+        ],
+        [
+          "modifyvm",
+          "{{.Name}}",
+          "--vrde",
+          "on"
+        ],
+        [
+          "modifyvm",
+          "{{.Name}}",
+          "--vrdeport",
+          "5000-5050"
+        ],
+        [
+          "modifyvm",
+          "{{.Name}}",
+          "--vrdeaddress",
+          "127.0.0.1"
+        ]
       ]
     },
     {
@@ -193,7 +224,10 @@
     {
       "type": "qemu",
       "qemuargs": [
-        [ "-m", "1024M" ]
+        [
+          "-m",
+          "1024M"
+        ]
       ],
       "vm_name": "{{ user `distro` }}-{{ isotime \"200601021504\"  }}",
       "output_directory": "images/{{ user `distro` }}-qemu-{{ isotime \"200601021504\"  }}",
@@ -235,8 +269,8 @@
         " preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg<wait>",
         " -- <wait>",
         "<enter><wait>"
-     ]
-   },
+      ]
+    },
     {
       "type": "docker",
       "image": "ubuntu:14.04",
@@ -247,8 +281,8 @@
       "api_token": "{{user `do_api_token`}}",
       "image": "{{user `distro`}}",
       "snapshot_name": "{{ user `distro` }}-{{ isotime \"200601021504\"  }}",
-      "region" : "ams2",
-      "size" : "1gb"
+      "region": "ams2",
+      "size": "1gb"
     }
   ]
-}
+}
\ No newline at end of file