-
Notifications
You must be signed in to change notification settings - Fork 16
/
Vagrantfile
215 lines (178 loc) · 6.67 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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
# Specify minimum Vagrant version
Vagrant.require_version ">= 1.6.2"
# Load external configuration from LocalVagrantConfig.rb (if present)
# else load it from DefaultVagrantConfig.rb
LOCAL_CONFIG_RB="#{File.dirname(__FILE__)}/LocalVagrantConfig.rb";
DEFAULT_CONFIG_RB="#{File.dirname(__FILE__)}/DefaultVagrantConfig.rb";
if File.exist?(LOCAL_CONFIG_RB)
# puts "Loading local config from #{LOCAL_CONFIG_RB}"
require LOCAL_CONFIG_RB
else
# puts "Loading default config from #{DEFAULT_CONFIG_RB}"
require DEFAULT_CONFIG_RB
end
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.boot_timeout = 720
# Every Vagrant virtual environment requires a box to build off of.
# Version 0.2.0 is Ubuntu 14.04 LTS built from "ubuntu/trusty64"
config.vm.box = "msgilligan/mastercoin-ubuntu-base"
config.vm.synced_folder ".", "/vagrant", id: "vagrant-root", disabled: true
config.vm.synced_folder "synced", "/vagrant", id: "vagrant-synced", disabled: false
config.vm.provider "virtualbox" do |v|
v.memory = 3840 # 3.75 GB, same as Amazon m3.medium
v.cpus = 4
#v.customize ["modifyvm", :id, "--cpuexecutioncap", "50"] #limit the use of cpu to 50%
end
config.vm.provider :aws do |aws, override|
aws.access_key_id = ENV['AWS_ACCESS_KEY'] || ""
aws.secret_access_key = ENV['AWS_SECRET_KEY'] || ""
aws.keypair_name = ENV['AWS_KEYPAIR_NAME'] || ""
aws.region = AWS_DEFAULT_REGION
aws.instance_type = "t2.small"
aws.security_groups = [ 'web' ]
aws.ami = "ami-39501209" # uswest-2, amd64, type="hvm:ebs", Release: 20140927
aws.block_device_mapping = [{ 'DeviceName' => '/dev/sda1', 'Ebs.VolumeSize' => 60, 'Ebs.DeleteOnTermination' => false }]
override.vm.box = "omni-aws"
override.ssh.username = "ubuntu"
override.ssh.private_key_path = ENV['AWS_SSH_KEY_PATH'] || ""
end
#
# base
#
# Configuration for a base Ubuntu VM for Mastercoin
#
# Updated Ubuntu, make, git, libboost, etc
# See install-mastercoin-base-root.sh for details
#
# This VM is published on https://vagrantcloud.com as
# 'msgilligan/mastercoin-ubuntu-base' and used as the
# base box by all other VMs in this Vagrantfile.
#
config.vm.define "base", autostart: false do |base|
base.vm.box = "ubuntu/trusty64"
base.vm.provision "shell" do |s|
s.path = "install-mastercoin-base-root.sh"
end
end
#
# empty
#
# Configuration for an empty install based on 'base'
#
config.vm.define "empty", autostart: false do |empty|
end
#
# omniwallet
#
# Configuration for Ubuntu VM with Omniwallet
#
# Production is m1.small (do we need that instance storage or should we use a t2 or m3 instance?)
# Currently testing with t2.small
#
config.vm.define "omniwallet" do |omni|
omni.vm.network :forwarded_port, host_ip: "127.0.0.1", guest: 80, host: 1666
omni.vm.synced_folder "omniwallet-synced", "/vagrant", id: "vagrant-synced", disabled: false
omni.vm.provision "shell" do |s|
s.privileged = false
s.path = "install-omniwallet-user.sh"
s.args = [OMNIWALLET_GIT_REPO, # Git Repo to clone/checkout from
OMNIWALLET_GIT_BRANCH, # Branch to checkout
BTCRPC_CONNECT, # Bitcoin RPC Host
BTCRPC_USER, # Bitcoin RPC username
BTCRPC_PASSWORD, # Bitcoin RPC password
BTCRPC_SSL, # Use SSL for RPC
PGHOST, # Postgres host
OMNIDB_WWW_USER, # Postgres username
OMNIDB_WWW_PASSWORD, # Postgres password
PGPORT] # Postgres port
end
omni.vm.provider "virtualbox" do |v|
v.memory = 1024
v.cpus = 2
end
omni.vm.provider "aws" do |aws|
aws.tags = {
'Name' => 'omniwallet',
'Type' => 'vagrant-omniwallet'
}
end
end
#
# omniengine
#
# Configuration for Ubuntu VM with OmniEngine
#
# Production is t2.micro
#
config.vm.define "omniengine" do |omni|
omni.vm.synced_folder "omniengine-synced", "/vagrant", id: "vagrant-synced", disabled: false
omni.vm.provision "shell" do |s|
s.privileged = false
s.path = "install-omniengine-user.sh"
s.args = [OMNIENGINE_GIT_REPO, # Repo to clone
OMNIENGINE_GIT_BRANCH, # Branch to checkout
BTCRPC_CONNECT, # Bitcoin RPC Host
BTCRPC_USER, # Bitcoin RPC username
BTCRPC_PASSWORD, # Bitcoin RPC password
BTCRPC_SSL, # Use SSL for RPC
PGHOST, # Postgres host
OMNIDB_ENGINE_USER, # Postgres username
OMNIDB_ENGINE_PASSWORD, # Postgres password
PGPORT] # Postgres port
end
omni.vm.provider "virtualbox" do |v|
v.memory = 1024
v.cpus = 2
end
omni.vm.provider "aws" do |aws|
aws.instance_type = "t2.micro"
aws.tags = {
'Name' => 'omniengine',
'Type' => 'vagrant-omniengine'
}
end
end
#
# mastercore
#
# Configuration for Master Core deployment
#
# Master Core is currently built from source code.
#
# Omni Production is m3.medium
# Currently testing with t2.small
#
config.vm.define "mastercore", autostart: false do |mastercore|
mastercore.vm.synced_folder "mastercore-synced", "/vagrant", id: "vagrant-synced", disabled: false
mastercore.vm.network :forwarded_port, host_ip: "127.0.0.1", guest: 8332, host: 38332
mastercore.vm.provision "shell" do |s|
s.path = "install-mastercoin-base-root.sh"
end
mastercore.vm.provision "shell" do |s|
s.privileged = false
s.path = "clone-build-install-bitcoind.sh"
s.args = [MASTERCORE_GIT_REPO, # Git Repo to clone/checkout from
MASTERCORE_GIT_BRANCH, # Branch to check out
"mastercore", # Directory to clone into
BTCRPC_CONNECT, # Bitcoin RPC Host
BTCRPC_USER, # Bitcoin RPC username
BTCRPC_PASSWORD, # Bitcoin RPC password
BTCRPC_SSL, # Use SSL for RPC
"*"] # BTCRPC_ALLOWIP -- IP addresses to allow
end
mastercore.vm.provider "virtualbox" do |v|
v.memory = 2048
v.cpus = 8
end
mastercore.vm.provider "aws" do |aws|
aws.tags = {
'Name' => 'mastercore',
'Type' => 'vagrant-mastercore'
}
end
end
end