forked from wal-e/chef-wal-e
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVagrantfile.example
74 lines (68 loc) · 2.36 KB
/
Vagrantfile.example
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
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
chef_json = {
postgresql: {
password: {
postgres: "howdy"
},
version: 9.3,
config: {
# this seems to be required off for now
ssl: false
},
streaming: {
master_host: "192.168.7.10"
},
},
wal_e: {
aws_access_key: nil, # 'YOUR_ACCESS_KEY_HERE',
aws_secret_key: nil, # 'YOUR_SECRET_KEY_HERE',
s3_bucket: nil, # 'YOUR_BUCKET_MUST_ALREADY_EXIST'
}
}
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
# please see the online documentation at vagrantup.com.
# Every Vagrant virtual environment requires a box to build off of.
config.vm.box = "precise64"
config.vm.network "public_network"
# this is not really needed, but archiving locally is weird
config.vm.synced_folder "pgdata/", "/share/psql", mount_options: %w(dmode=777 fmode=644)
# define our psql master
config.vm.define :master do |conf|
conf.vm.host_name = "masterblaster"
conf.vm.network 'private_network', ip: "192.168.7.10"
conf.vm.provider :virtualbox do |vb|
vb.customize ["modifyvm", :id, "--memory", "2048"]
end
config.vm.provision :chef_solo do |chef|
chef.cookbooks_path = "../my-recipes/cookbooks"
chef.roles_path = "../my-recipes/roles"
chef.add_recipe( "postgresql::server_streaming_master" )
# only the master does this
chef.add_recipe( "chef-wal-e" )
chef.json = chef_json
end
#conf.vm.provision "shell",
# inline: "apt-get -y install postgresql-9.3"
end
# define our slaves, two for now
{ slave1: 31, slave2: 32 }.each do |slave,ip|
config.vm.define slave do |conf|
conf.vm.host_name = "pgsql-#{slave}"
conf.vm.network 'private_network', ip: "192.168.7.#{ip}"
conf.vm.provider :virtualbox do |vb|
vb.customize ["modifyvm", :id, "--memory", "1024"]
end
config.vm.provision :chef_solo do |chef|
chef.cookbooks_path = "../my-recipes/cookbooks"
chef.roles_path = "../my-recipes/roles"
chef.add_recipe( "postgresql::server_streaming_slave" )
chef.json = chef_json
end
end
end
end