-
Notifications
You must be signed in to change notification settings - Fork 13
/
Vagrantfile
46 lines (35 loc) · 1.23 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 -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2"
http_port = 1080
base_url = "http://localhost:#{http_port}"
$info_message = <<SCRIPT
echo "================================================================================\n"
echo "grafana up and running at #{base_url}/grafana"
echo "================================================================================\n"
SCRIPT
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.synced_folder ".", "/vagrant", disabled: true
config.vm.network "forwarded_port", guest: 80, host: http_port
config.vm.network "forwarded_port", guest: 2003, host: 2003
config.vm.provider :virtualbox do |vb|
vb.customize ["modifyvm", :id, "--memory", "2048"]
vb.customize ["modifyvm", :id, "--cpus", "2"]
end
config.vm.provision :ansible do |ansible|
ansible.playbook = "site.yml"
ansible.groups = {
"graphite-grafana" => ["default"]
}
ansible.extra_vars = {
base_url: base_url
}
end
if Vagrant.has_plugin?("vagrant-serverspec") and Vagrant.has_plugin?("infrataster")
config.vm.provision :serverspec do |spec|
spec.pattern = 'spec/*_spec.rb'
end
end
config.vm.provision "shell", inline: $info_message
end