-
Notifications
You must be signed in to change notification settings - Fork 33
/
Vagrantfile
46 lines (36 loc) · 1.36 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
# -*- mode: ruby -*-
# -*- coding: utf-8 -*-
Vagrant.require_version '>= 1.6.0'
rethinkdb_host_ip = '198.162.50.11'
Vagrant.configure(2) do |config|
# always use Vagrants insecure key
config.ssh.insert_key = false
# Ubuntu 16.04, 64 bit
config.vm.box = "bento/ubuntu-16.04"
config.vm.define "rethinkdb"
# Set memory to 1024
# Allow I/O APIC
config.vm.provider :virtualbox do |v|
v.name = 'rethinkdb_ubuntu'
v.customize ['modifyvm', :id, '--memory', '1024', '--ioapic', 'on']
end
# Static IP
config.vm.network :private_network, ip: rethinkdb_host_ip
config.vm.network "forwarded_port", guest: 8080, host: 8080
# Provisioning
config.vm.provision :shell do |sh|
sh.inline = <<-EOF
export DEBIAN_FRONTEND=noninteractive;
# Add RethinkDB Source
apt-key adv --fetch-keys http://download.rethinkdb.com/apt/pubkey.gpg 2>&1;
echo "deb http://download.rethinkdb.com/apt $(lsb_release -sc) main" > /etc/apt/sources.list.d/rethinkdb.list;
apt-get update --assume-yes;
# RethinkDB Install & Setup
apt-get install --assume-yes rethinkdb;
sed -e 's/# bind=127.0.0.1/bind=all/g' /etc/rethinkdb/default.conf.sample > /etc/rethinkdb/instances.d/default.conf;
rethinkdb create -d /var/lib/rethinkdb/instances.d/default 2>&1;
# Start rethinkdb
/etc/init.d/rethinkdb restart;
EOF
end
end