forked from sous-chefs/redisio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Vagrantfile
65 lines (55 loc) · 2.1 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
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2"
base_box = "precise32"
url = "http://files.vagrantup.com/precise32.box"
cookbooks_path = ["../","cookbooks/"]
chef_upgrade = %q{ which apt-get > /dev/null 2>&1 && apt-get install curl --yes
gem install chef --no-rdoc --no-ri }
easy_run_solo = %q{ echo "sudo chef-solo -c /tmp/vagrant-chef-1/solo.rb -j /tmp/vagrant-chef-1/dna.json" > /home/vagrant/solo.sh
chmod 775 /home/vagrant/solo.sh
chown vagrant:vagrant /home/vagrant/solo.sh }
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.berkshelf.berksfile_path = "./Berksfile"
config.berkshelf.enabled = true
config.vm.define :redisio do |r|
r.vm.box = base_box
r.vm.box_url = url
r.vm.network :private_network, :ip => "192.168.50.5"
r.vm.provision :shell, :inline => "sudo apt-get -y install build-essential"
r.vm.provision :shell, :inline => chef_upgrade
r.vm.provision :shell, :inline => easy_run_solo
r.vm.provision :chef_solo do |chef|
chef.cookbooks_path = cookbooks_path
chef.add_recipe "redisio::default"
chef.add_recipe "redisio::enable"
chef.json = {
'redisio' => {
'servers' => [
{'port' => 6379}
]
}
}
end
end
config.vm.define :sentinel do |s|
s.vm.box = base_box
s.vm.box_url = url
s.vm.network :private_network, :ip => "192.168.50.10"
s.vm.provision :shell, :inline => "sudo apt-get -y install build-essential"
s.vm.provision :shell, :inline => chef_upgrade
s.vm.provision :shell, :inline => easy_run_solo
s.vm.provision :chef_solo do |chef|
chef.cookbooks_path = cookbooks_path
chef.add_recipe "redisio::sentinel"
chef.add_recipe "redisio::sentinel_enable"
chef.json = {
'redisio' => {
'sentinels' => [
{'sentinel_bind' => '0.0.0.0', 'sentinel_port' => 26379, 'name' => 'redisio', 'master_ip' => '192.168.50.5', 'master_port' => '6379'}
]
}
}
end
end
end