mirror of
https://github.com/krislamo/graylog_demo
synced 2024-11-09 21:50:35 +00:00
Create multiple VMs
This commit is contained in:
parent
79980fde84
commit
d9139b715a
27
Vagrantfile
vendored
27
Vagrantfile
vendored
@ -1,18 +1,26 @@
|
||||
# vi: set ft=ruby :
|
||||
|
||||
PRIVATE_NET_IP = "172.28.128.30"
|
||||
PRIVATE_NET_IP = "172.28.128."
|
||||
|
||||
Vagrant.configure("2") do |config|
|
||||
config.vm.box = "centos/7"
|
||||
config.vm.network "private_network", ip: PRIVATE_NET_IP
|
||||
config.vm.synced_folder ".", "/vagrant", type: "nfs"
|
||||
|
||||
config.vm.provider "virtualbox" do |vbox|
|
||||
vmservers = ["graylog", "systems"]
|
||||
last_octet = 30
|
||||
|
||||
vmservers.each do |server|
|
||||
config.vm.define "#{server}" do |node|
|
||||
node.vm.box = "centos/7"
|
||||
node.vm.hostname = "#{server}"
|
||||
node.vm.network "private_network", ip: PRIVATE_NET_IP + last_octet.to_s
|
||||
node.vm.synced_folder ".", "/vagrant", type: "nfs"
|
||||
last_octet = last_octet + 1
|
||||
|
||||
node.vm.provider "virtualbox" do |vbox|
|
||||
vbox.memory = 4096
|
||||
vbox.cpus = 4
|
||||
end
|
||||
|
||||
config.vm.provision "shell", inline: <<-SHELL
|
||||
node.vm.provision "shell", inline: <<-SHELL
|
||||
|
||||
# Set SELinux to permissive
|
||||
setenforce 0
|
||||
@ -71,10 +79,11 @@ Vagrant.configure("2") do |config|
|
||||
SHELL
|
||||
|
||||
# Install newest docker-compose
|
||||
config.vm.provision "shell", path: "install-compose.sh"
|
||||
node.vm.provision "shell", path: "install-compose.sh"
|
||||
|
||||
# Start compose services and add default input
|
||||
config.vm.provision "shell", inline: <<-SHELL
|
||||
node.vm.provision "shell", inline: <<-SHELL
|
||||
|
||||
# Bring up containers
|
||||
cd /vagrant
|
||||
/usr/local/bin/docker-compose up -d 2> /dev/null
|
||||
@ -132,4 +141,6 @@ Vagrant.configure("2") do |config|
|
||||
-d @GELFTCPInput.json
|
||||
SHELL
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user