Skip to content

Commit 01d4f92

Browse files
committed
Reorganize Vagrantfile to make room for more images
1 parent d32f008 commit 01d4f92

File tree

5 files changed

+48
-43
lines changed

5 files changed

+48
-43
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ tags
3838
*.out
3939
*.mem
4040
*.php
41-
*.sh
41+
tests/*/*.sh
4242
php.ini
4343
*.patch
4444
*.swp

Vagrantfile

Lines changed: 11 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,30 @@
11
# -*- mode: ruby -*-
2-
# vi: set ft=ruby :
2+
# vi: set ft=ruby et sw=2 :
33

44
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"
85

96
config.vm.synced_folder ".", "/phongo"
107

118
config.vm.provider "vmware_workstation" do |vmware, override|
129
vmware.vmx["memsize"] = "8192"
1310
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-
11+
override.vm.provision "shell", path: "scripts/vmware/kernel.sh"
2312
end
2413

14+
config.vm.define "default", primary: true do |mo|
15+
mo.vm.network "private_network", ip: "192.168.112.10"
2516

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
17+
mo.vm.box = "http://files.vagrantup.com/precise64.box"
18+
mo.vm.provider "vmware_workstation" do |vmware, override|
19+
override.vm.box_url = 'http://files.vagrantup.com/precise64_vmware.box'
20+
end
3121

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
22+
mo.vm.provision "shell", path: "scripts/ubuntu/essentials.sh"
23+
mo.vm.provision "shell", path: "scripts/ubuntu/mongo-orchestration.sh"
24+
end
4025

41-
# Latest MongoDB Enterprise
42-
sudo apt-get install -y mongodb-enterprise
4326

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
5527

56-
# Launch mongo-orchestration
57-
mongo-orchestration -b 192.168.112.10 start
58-
SHELL
5928

6029
end
6130

scripts/ubuntu/essentials.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Tools you can't live without
2+
sudo apt-get install -y build-essential git vim
3+
4+
# I can't stand emacs
5+
echo 'set -o vi' | sudo tee /etc/profile.d/vishell.sh
6+
7+

scripts/ubuntu/mongo-orchestration.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Enable MongoDB Enterprise repo
2+
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
3+
echo 'deb http://repo.mongodb.com/apt/ubuntu precise/mongodb-enterprise/stable multiverse' | sudo tee /etc/apt/sources.list.d/mongodb-enterprise.list
4+
sudo apt-get update
5+
6+
# Python stuff for mongo-orchestration
7+
sudo apt-get install -y python python-dev python-pip
8+
9+
# Latest MongoDB Enterprise
10+
sudo apt-get install -y mongodb-enterprise
11+
12+
# FIXME Replace the DELETE ME with this line when PR#153 has been released
13+
# pip install mongo-orchestration
14+
####### DELETE ME
15+
# Checkout orchestration from VCS and the latest pip doesn't support -b
16+
git clone https://github.com/10gen/mongo-orchestration.git
17+
pushd mongo-orchestration
18+
sudo python setup.py install
19+
popd
20+
####### DELETE ME
21+
22+
# Launch mongo-orchestration
23+
mongo-orchestration -b 192.168.112.10 start
24+

scripts/vmware/kernel.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Ensure that VMWare Tools recompiles kernel modules
2+
# when we update the linux images
3+
sed -i.bak 's/answer AUTO_KMODS_ENABLED_ANSWER no/answer AUTO_KMODS_ENABLED_ANSWER yes/g' /etc/vmware-tools/locations
4+
sed -i.bak 's/answer AUTO_KMODS_ENABLED no/answer AUTO_KMODS_ENABLED yes/g' /etc/vmware-tools/locations
5+

0 commit comments

Comments
 (0)