Skip to content
This repository has been archived by the owner on Jul 16, 2020. It is now read-only.

Commit

Permalink
Merge pull request #1146 from markdryan/clean-up-cloud-init
Browse files Browse the repository at this point in the history
ciao-down: Use apt section of cloudinit file
  • Loading branch information
kaccardi committed Feb 14, 2017
2 parents a4e0467 + 1e0581a commit dc8a917
Showing 1 changed file with 18 additions and 15 deletions.
33 changes: 18 additions & 15 deletions testutil/ciao-down/cloudinit.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@ mounts:
{{if len .UIPath }} - [hostui, {{.UIPath}}, 9p, "x-systemd.automount,x-systemd.device-timeout=10,nofail,trans=virtio,version=9p2000.L", "0", "0"]{{end}}
write_files:
{{- if len $.HTTPProxy }}
- content: |
Acquire::http::Proxy "{{$.HTTPProxy}}";
path: /etc/apt/apt.conf
- content: |
[Service]
Environment="HTTP_PROXY={{$.HTTPProxy}}"{{if len .HTTPSProxy}} "HTTPS_PROXY={{.HTTPSProxy}}{{end}}"{{if len .NoProxy}} "NO_PROXY={{.NoProxy}},singlevm{{end}}"
Expand All @@ -62,6 +59,15 @@ write_files:
deb https://apt.dockerproject.org/repo ubuntu-xenial main
path: /etc/apt/sources.list.d/docker.list
apt:
{{- if len $.HTTPProxy }}
proxy: "{{$.HTTPProxy}}"
{{- end}}
{{- if len $.HTTPSProxy }}
https_proxy: "{{$.HTTPSProxy}}"
{{- end}}
package_upgrade: true
runcmd:
- echo "127.0.0.1 singlevm" >> /etc/hosts
- mount hostgo
Expand Down Expand Up @@ -109,10 +115,6 @@ runcmd:
- {{template "ENV" .}}apt-get update
- {{template "CHECK" .}}
- curl -X PUT -d "Upgrading" 10.0.2.2:{{.HTTPServerPort}}
- {{template "ENV" .}}apt-get upgrade -y
- {{template "CHECK" .}}
- curl -X PUT -d "Installing Docker" 10.0.2.2:{{.HTTPServerPort}}
- {{template "ENV" .}}apt-get install docker-engine -y
- {{template "CHECK" .}}
Expand Down Expand Up @@ -256,9 +258,6 @@ mounts:
- [hostgo, {{.GoPath}}, 9p, "x-systemd.automount,x-systemd.device-timeout=10,nofail,trans=virtio,version=9p2000.L", "0", "0"]
write_files:
{{- if len $.HTTPProxy }}
- content: |
Acquire::http::Proxy "{{$.HTTPProxy}}";
path: /etc/apt/apt.conf
- content: |
[Service]
Environment="HTTP_PROXY={{$.HTTPProxy}}"{{if len .HTTPSProxy}} "HTTPS_PROXY={{.HTTPSProxy}}{{end}}"{{if len .NoProxy}} "NO_PROXY={{.NoProxy}},singlevm{{end}}"
Expand All @@ -283,6 +282,15 @@ write_files:
deb https://apt.dockerproject.org/repo ubuntu-xenial main
path: /etc/apt/sources.list.d/docker.list
apt:
{{- if len $.HTTPProxy }}
proxy: "{{$.HTTPProxy}}"
{{- end}}
{{- if len $.HTTPSProxy }}
https_proxy: "{{$.HTTPSProxy}}"
{{- end}}
package_upgrade: true
runcmd:
- echo "127.0.0.1 singlevm" >> /etc/hosts
- mount hostgo
Expand Down Expand Up @@ -330,15 +338,10 @@ runcmd:
- {{template "ENV" .}}curl -fsSL http://download.opensuse.org/repositories/home:clearlinux:preview:clear-containers-2.1/xUbuntu_16.04/Release.key | sudo apt-key add -
- {{template "CHECK" .}}
- curl -X PUT -d "Retrieving updated list of packages" 10.0.2.2:{{.HTTPServerPort}}
- {{template "ENV" .}}apt-get update
- {{template "CHECK" .}}
- curl -X PUT -d "Upgrading" 10.0.2.2:{{.HTTPServerPort}}
- {{template "ENV" .}}apt-get upgrade -y
- {{template "CHECK" .}}
- curl -X PUT -d "Installing Clear Containers Runtime" 10.0.2.2:{{.HTTPServerPort}}
- {{template "ENV" .}}apt-get install cc-oci-runtime -y
- {{template "CHECK" .}}
Expand Down

0 comments on commit dc8a917

Please sign in to comment.