Skip to content

Commit 7c5d150

Browse files
committed
PHON-91: Use Vagrant to virtualise mongod
1 parent b55ab72 commit 7c5d150

File tree

2 files changed

+65
-0
lines changed

2 files changed

+65
-0
lines changed

Makefile.frag

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ composer:
4444
exit 1; \
4545
fi
4646

47+
vm:
48+
@command -v vagrant >/dev/null 2>&1 || { echo >&2 "Vagrant needs to be installed to run vms"; exit 1; }
49+
@vagrant up
50+
4751
test-bootstrap:
4852
php scripts/start-servers.php
4953

Vagrantfile

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# -*- mode: ruby -*-
2+
# vi: set ft=ruby :
3+
4+
Vagrant.configure(2) do |config|
5+
config.vm.box = "http://files.vagrantup.com/precise64.box"
6+
7+
config.vm.network "private_network", ip: "192.168.112.10"
8+
9+
config.vm.synced_folder ".", "/phongo"
10+
11+
config.vm.provider "vmware_workstation" do |vmware, override|
12+
vmware.vmx["memsize"] = "8192"
13+
vmware.vmx["numvcpus"] = "2"
14+
15+
override.vm.box_url = 'http://files.vagrantup.com/precise64_vmware.box'
16+
override.vm.provision "shell", inline: <<-SHELL
17+
# Ensure that VMWare Tools recompiles kernel modules
18+
# when we update the linux images
19+
sed -i.bak 's/answer AUTO_KMODS_ENABLED_ANSWER no/answer AUTO_KMODS_ENABLED_ANSWER yes/g' /etc/vmware-tools/locations
20+
sed -i.bak 's/answer AUTO_KMODS_ENABLED no/answer AUTO_KMODS_ENABLED yes/g' /etc/vmware-tools/locations
21+
SHELL
22+
23+
end
24+
25+
26+
config.vm.provision "shell", inline: <<-SHELL
27+
# Enable MongoDB Enterprise repo
28+
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
29+
echo 'deb http://repo.mongodb.com/apt/ubuntu precise/mongodb-enterprise/stable multiverse' | sudo tee /etc/apt/sources.list.d/mongodb-enterprise.list
30+
sudo apt-get update
31+
32+
# Tools you can't live without
33+
sudo apt-get install -y build-essential git vim
34+
35+
# I can't stand emacs
36+
echo 'set -o vi' | sudo tee /etc/profile.d/vishell.sh
37+
38+
# Python stuff for mongo-orchestration
39+
sudo apt-get install -y python python-dev python-pip
40+
41+
# Latest MongoDB Enterprise
42+
sudo apt-get install mongodb-enterprise
43+
44+
# FIXME Replace the DELETE ME with this line when PR#153 has been merged
45+
# pip install mongo-orchestration
46+
####### DELETE ME
47+
# Checkout orchestration from VCS and the latest pip doesn't support -b
48+
git clone https://github.com/10gen/mongo-orchestration.git
49+
pushd mongo-orchestration
50+
wget https://github.com/10gen/mongo-orchestration/pull/153.patch
51+
git am 153.patch
52+
sudo python setup.py install
53+
popd
54+
####### DELETE ME
55+
56+
# Launch mongo-orchestration
57+
mongo-orchestration -b 192.168.112.10 start
58+
SHELL
59+
60+
end
61+

0 commit comments

Comments
 (0)