This repository has been archived by the owner on Dec 5, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Vagrantfile
102 lines (81 loc) · 2.79 KB
/
Vagrantfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# Copyright (C) 2014 by Alex Brandt <[email protected]>
#
# margarine is freely distributable under the terms of an MIT-style license.
# See COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.require_plugin 'vagrant-omnibus'
Vagrant.require_plugin 'vagrant-berkshelf'
ip_addresses = {
:tinge => '192.0.2.2',
:blend => '192.0.2.3',
:spread => '192.0.2.4',
:queue => '192.0.2.5',
:token_store => '192.0.2.6',
:datastore => '192.0.2.7',
}
Vagrant.configure('2') do |config|
config.vm.box = 'precise64'
config.vm.box_url = 'http://files.vagrantup.com/precise64.box'
config.vm.define 'token_store' do |token_store|
token_store.vm.network :private_network, ip: ip_addresses[:token_store]
token_store.vm.synced_folder '.', '/vagrant', :disabled => true
token_store.vm.provision 'shell', inline: <<-EOF
apt-get -qq update
apt-get -qq -y install redis-server
sed -i -e \'s/bind 127.0.0.1/#\0/\' /etc/redis/redis.conf
service redis-server restart
EOF
end
config.vm.define 'queue' do |queue|
queue.vm.network :private_network, ip: ip_addresses[:queue]
queue.vm.synced_folder '.', '/vagrant', :disabled => true
queue.omnibus.chef_version = :latest
queue.vm.provision :chef_solo do |chef|
chef.node_name = 'queue'
chef.log_level = :warn
chef.json = {
'rabbitmq' => {
'enabled_plugins' => [
'rabbitmq_management',
],
'use_distro_version' => true,
},
}
chef.add_recipe 'apt'
chef.add_recipe 'rabbitmq'
chef.add_recipe 'rabbitmq::plugin_management'
end
end
config.vm.define 'datastore' do |datastore|
datastore.vm.network :private_network, ip: ip_addresses[:datastore]
datastore.vm.synced_folder '.', '/vagrant', :disabled => true
datastore.omnibus.chef_version = :latest
datastore.vm.provision :chef_solo do |chef|
chef.node_name = 'datastore'
chef.log_level = :warn
chef.json = {
'build_essentail' => {
'compiletime' => true,
},
}
chef.add_recipe 'apt'
chef.add_recipe 'build-essential'
chef.add_recipe 'mongodb::10gen_repo'
chef.add_recipe 'mongodb'
end
end
[ :tinge, :blend, :spread ].each do |component|
config.vm.define component do |box|
box.vm.network :private_network, ip: ip_addresses[component]
box.vm.provision 'shell', inline: <<-EOF
apt-get -qq update
apt-get -qq -y install python-pip build-essential python-dev
ln -snf /vagrant/conf /etc/margarine
pip install -q -e /vagrant
start-stop-daemon -Sbmp /run/#{component}.pid --exec /usr/local/bin/#{component}
EOF
end
end
end