-
Notifications
You must be signed in to change notification settings - Fork 2
/
Vagrantfile
66 lines (61 loc) · 1.89 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
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
# ensure to have vagrant-vbguest installed
required_plugins = %w( vagrant-vbguest )
_retry = false
required_plugins.each do |plugin|
unless Vagrant.has_plugin? plugin
system "vagrant plugin install #{plugin}"
_retry = true
end
end
if (_retry)
exec "vagrant " + ARGV.join(' ')
end
# graylog VM
config.vm.define "graylog" do |graylog|
graylog.vm.box = "debian/stretch64"
graylog.vm.hostname = "graylog"
# VM options
graylog.vm.provider "virtualbox" do |vb|
vb.memory = "4096"
end
# forward some ports
graylog.vm.network "forwarded_port", guest: 9000, host: 9000 # graylog
graylog.vm.network "forwarded_port", guest: 3000, host: 3000 # grafana
# private network
graylog.vm.network "private_network", ip: "192.168.1.10"
# update system
graylog.vm.provision "shell", inline: <<-SHELL
echo "set grub-pc/install_devices /dev/sda" | debconf-communicate
apt-get update && apt-get upgrade -y
SHELL
# install graylog
graylog.vm.provision "ansible_local" do |ansible|
ansible.playbook = "graylog.yml"
end
end
# client VM
config.vm.define "client" do |client|
client.vm.box = "debian/stretch64"
client.vm.hostname = "client"
# VM options
client.vm.provider "virtualbox" do |vb|
vb.memory = "512"
end
# forward some ports
client.vm.network "forwarded_port", guest: 80, host: 8080 # http
# private network
client.vm.network "private_network", ip: "192.168.1.11"
# update system
client.vm.provision "shell", inline: <<-SHELL
echo "set grub-pc/install_devices /dev/sda" | debconf-communicate
apt-get update && apt-get upgrade -y
SHELL
# prepare client
client.vm.provision "ansible_local" do |ansible|
ansible.playbook = "client.yml"
end
end
end