mirror of
https://github.com/krislamo/graylog_demo
synced 2025-01-07 05:50:34 +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 :
|
# vi: set ft=ruby :
|
||||||
|
|
||||||
PRIVATE_NET_IP = "172.28.128.30"
|
PRIVATE_NET_IP = "172.28.128."
|
||||||
|
|
||||||
Vagrant.configure("2") do |config|
|
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.memory = 4096
|
||||||
vbox.cpus = 4
|
vbox.cpus = 4
|
||||||
end
|
end
|
||||||
|
|
||||||
config.vm.provision "shell", inline: <<-SHELL
|
node.vm.provision "shell", inline: <<-SHELL
|
||||||
|
|
||||||
# Set SELinux to permissive
|
# Set SELinux to permissive
|
||||||
setenforce 0
|
setenforce 0
|
||||||
@ -71,10 +79,11 @@ Vagrant.configure("2") do |config|
|
|||||||
SHELL
|
SHELL
|
||||||
|
|
||||||
# Install newest docker-compose
|
# 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
|
# Start compose services and add default input
|
||||||
config.vm.provision "shell", inline: <<-SHELL
|
node.vm.provision "shell", inline: <<-SHELL
|
||||||
|
|
||||||
# Bring up containers
|
# Bring up containers
|
||||||
cd /vagrant
|
cd /vagrant
|
||||||
/usr/local/bin/docker-compose up -d 2> /dev/null
|
/usr/local/bin/docker-compose up -d 2> /dev/null
|
||||||
@ -133,3 +142,5 @@ Vagrant.configure("2") do |config|
|
|||||||
SHELL
|
SHELL
|
||||||
|
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user