deb-designate/contrib/devstack/Vagrantfile
Kiall Mac Innes d9b15425ed DevStack/Vagrant: Specify the minimum supported Vagrant version
Change-Id: I56cc2cc506c55deb2e11425a44b40f170492495e
2014-06-10 00:48:42 +01:00

73 lines
2.4 KiB
Ruby

VAGRANTFILE_API_VERSION = "2"
GITCONFIG = `cat $HOME/.gitconfig`
Vagrant.require_version ">= 1.5"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.ssh.forward_agent = true
config.vm.synced_folder "../..", "/opt/stack/designate"
if File.directory?("../../../python-designateclient")
config.vm.synced_folder "../../../python-designateclient", "/opt/stack/python-designateclient"
end
config.vm.provider "virtualbox" do |vb|
vb.customize ["modifyvm", :id, "--memory", "2048"]
vb.customize ["modifyvm", :id, "--cpus", `grep "^core id" /proc/cpuinfo | sort | uniq | wc -l | tr -d '\n'`]
vb.customize ["modifyvm", :id, "--nicpromisc3", "allow-all"]
end
$script = <<SCRIPT
set -e
# Copy over git config
cat << EOF > /home/vagrant/.gitconfig
#{GITCONFIG}
EOF
# Clone DevStack
if [ ! -d "/home/vagrant/devstack" ]; then
git clone https://git.openstack.org/openstack-dev/devstack.git /home/vagrant/devstack
fi
# Install Designate DevStack extension
cd /vagrant
if [ ! -f "/home/vagrant/devstack/localrc" ]; then
cp localrc /home/vagrant/devstack/localrc
fi
for f in lib/* extras.d/* exercises/*; do
if [ ! -f "/home/vagrant/devstack/$f" ]; then
ln -fs /vagrant/$f -t /home/vagrant/devstack/$(dirname $f)
fi
done
SCRIPT
config.vm.define "ubuntu" do |ubuntu|
ubuntu.vm.box = "rhefner/devstack-dependencies"
ubuntu.vm.network :private_network, ip: "192.168.27.100"
ubuntu.vm.network :private_network, ip: "172.24.4.225", :netmask => "255.255.255.224", :auto_config => false
ubuntu.vm.provision :shell, :privileged => true, :inline => "DEBIAN_FRONTEND=noninteractive apt-get update"
ubuntu.vm.provision :shell, :privileged => true, :inline => "DEBIAN_FRONTEND=noninteractive apt-get install --yes git"
ubuntu.vm.provision :shell, :privileged => false, :inline => $script
end
config.vm.define "fedora" do |fedora|
fedora.vm.box = "box-cutter/fedora20"
fedora.vm.network :private_network, ip: "192.168.27.101"
fedora.vm.network :private_network, ip: "172.24.4.226", :netmask => "255.255.255.224", :auto_config => false
fedora.vm.provision :shell, :privileged => true, :inline => "yum update -y vim-minimal" # RH Bug 1066983
fedora.vm.provision :shell, :privileged => true, :inline => "yum install -y git-core MySQL-python"
fedora.vm.provision :shell, :privileged => false, :inline => $script
end
end