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-16.04/template.json b/ubuntu-16.04/template.json
index dfeb46e..1d1a6d1 100644
--- a/ubuntu-16.04/template.json
+++ b/ubuntu-16.04/template.json
@@ -1,12 +1,11 @@
{
- "variables": {
- "user": "root",
- "password": "ho5uo7Uome5d",
- "do_api_token": "{{ env `DO_API_TOKEN` }}",
- "distro": "ubuntu-16-04-x64",
- "disk_size": "8000"
- },
-
+ "variables": {
+ "user": "root",
+ "password": "ho5uo7Uome5d",
+ "do_api_token": "{{ env `DO_API_TOKEN` }}",
+ "distro": "ubuntu-16-04-x64",
+ "disk_size": "8000"
+ },
"provisioners": [
{
"type": "shell",
@@ -16,7 +15,7 @@
"scripts": [
"scripts/base.sh",
"scripts/salt.sh",
- "scripts/network.sh",
+ "scripts/network.sh",
"scripts/vagrant.sh",
"scripts/virtualbox.sh",
"scripts/security.sh",
@@ -34,32 +33,32 @@
"scripts/zerodisk.sh"
]
},
- "qemu": {
+ "qemu": {
"scripts": [
"scripts/base.sh",
- "scripts/salt.sh",
+ "scripts/salt.sh",
"scripts/network.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"
+ ]
+ }
}
},
{
@@ -78,18 +77,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": "16.04",
- "only": ["docker"]
+ "only": [
+ "docker"
+ ]
},
{
"type": "docker-save",
"path": "images/{{ user `distro` }}-docker-{{ isotime \"200601021504\" }}.tar",
- "only": ["docker"]
+ "only": [
+ "docker"
+ ]
}
],
"builders": [
@@ -136,11 +142,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"
+ ]
]
},
{
@@ -195,7 +226,10 @@
{
"type": "qemu",
"qemuargs": [
- [ "-m", "1024M" ]
+ [
+ "-m",
+ "1024M"
+ ]
],
"vm_name": "{{ user `distro` }}-{{ isotime \"200601021504\" }}",
"output_directory": "images/{{ user `distro` }}-qemu-{{ isotime \"200601021504\" }}",
@@ -245,8 +279,8 @@
" preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg<wait>",
" -- <wait>",
"<enter><wait>"
- ]
- },
+ ]
+ },
{
"type": "docker",
"image": "ubuntu:16.04",
@@ -257,8 +291,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