extract vagrantfile shared bits

This commit is contained in:
Paul Bellamy authored and Ilya Dmitrichenko committed 2015-05-20 15:42:08 +01:00
1 parent a48777e482
commit d24e75f76b
3 files changed
+75 -68

No files matched your search

+4 -15
View File
@@ -9,18 +9,10 @@ n_machines = 2
ip_prefix = "192.168.48"
ip_suffix_base = 10
$cleanup = <<SCRIPT
export DEBIAN_FRONTEND=noninteractive
## Who the hell thinks official images have to have both of these?
/etc/init.d/chef-client stop
/etc/init.d/puppet stop
apt-get -qq remove puppet chef
apt-get -qq autoremove
killall -9 chef-client
SCRIPT
require '../vagrant-common.rb'
def configure_docker(host, hostname, ip)
pkgs = "lxc-docker ethtool"
pkgs = %w(lxc-docker ethtool)
host.vm.box = "ubuntu/ubuntu-14.10-amd64"
host.vm.box_url = "https://cloud-images.ubuntu.com/vagrant/utopic/current/utopic-server-cloudimg-amd64-vagrant-disk1.box"
@@ -33,16 +25,13 @@ def configure_docker(host, hostname, ip)
host.vm.provision :shell, :inline => "sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9"
host.vm.provision :shell, :inline => "echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list"
pkg_cmd = "apt-get update -qq; " \
"apt-get install -q -y --force-yes --no-install-recommends "
pkg_cmd << pkgs
host.vm.provision :shell, :inline => pkg_cmd
install_packages host.vm, pkgs
host.vm.provision :shell, :inline => "usermod -a -G docker vagrant; "
# Listen on the remote API
host.vm.provision :shell, :inline => "echo 'DOCKER_OPTS=\"-H unix:///var/run/docker.sock -H tcp://0.0.0.0:2375\"' >> /etc/default/docker"
host.vm.provision :shell, :inline => "service docker restart"
host.vm.provision :shell, :inline => $cleanup
cleanup(host.vm)
end