forked from mdsol/mesos_cookbook
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVagrantfile
93 lines (76 loc) · 2.2 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
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = '2'
Vagrant.require_version '>= 1.5.0'
$script = <<SCRIPT
# Install docker
sudo apt-get install -y\
apt-transport-https \
ca-certificates \
curl \
gnupg2 \
software-properties-common
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -
sudo apt-key fingerprint 0EBFCD88
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/debian \
$(lsb_release -cs) \
stable"
sudo apt-get update
sudo apt-get install -y docker-ce
sed -i 's_fd://_fd:// --insecure-registry registry.docker.duedil.net_' /lib/systemd/system/docker.service
sudo systemctl daemon-reload
sudo systemctl restart docker.service
SCRIPT
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
if Vagrant.has_plugin?("vagrant-omnibus")
config.omnibus.chef_version = 'latest'
end
config.vm.box = 'debian/contrib-jessie64'
# config.vm.synced_folder "/path/to/duedil", "/duedil"
config.vm.network :forwarded_port, guest: 80, host: 8080
config.vm.network :forwarded_port, guest: 443, host: 4443
# First machine
config.vm.define "first", primary: true do |first|
first.vm.network "private_network", ip: "192.168.33.33"
first.vm.hostname = "mesos"
end
# Second machine
# config.vm.define "second" do |second|
# second.network "private_network", ip: "192.168.33.34"
# end
# Berkshelf
config.berkshelf.enabled = true
# Configure memory and cpus
config.vm.provider :virtualbox do |vb|
vb.memory = 2048
vb.cpus = 2
end
config.vm.provision :chef_solo do |chef|
# Provide json
chef.json = {
'java' => {'jdk_version' => '7'},
'mesos' =>{
'version' => '1.1.0',
'master' => {
'flags' => {
'ip' => '192.168.33.33'
}
},
'slave' => {
'flags' => {
'ip' => '192.168.33.33',
'master' => 'zk://192.168.33.33:2181/mesos'
}
}
}
}
# Provide run list
chef.run_list = [
'recipe[zookeeper::default]',
'recipe[mesos_pkg::master]',
'recipe[mesos_pkg::slave]',
]
end
config.vm.provision "shell", inline: $script
end