mirror of
https://codeberg.org/27/inception-of-things.git
synced 2025-08-11 20:12:53 +02:00
45 lines
1.4 KiB
Ruby
45 lines
1.4 KiB
Ruby
# -*- mode: ruby -*-
|
|
#
|
|
# vi: set ft=ruby :
|
|
|
|
def environ(key, default)
|
|
ENV[key] || default
|
|
end
|
|
|
|
IOT_LOGIN = environ("IOT_LOGIN", "kiroussa")
|
|
IOT_PROVIDER = environ("IOT_PROVIDER", "virtualbox")
|
|
XDG_RUNTIME_DIR = environ("XDG_RUNTIME_DIR", "unknown")
|
|
if XDG_RUNTIME_DIR == "unknown"
|
|
raise "XDG_RUNTIME_DIR is not set"
|
|
end
|
|
|
|
# Here are the expected specifications:
|
|
# • The machine names must be the login of someone of your team. The hostname
|
|
# of the first machine must be followed by the capital letter S (like Server). The
|
|
# hostname of the second machine must be followed by SW (like ServerWorker).
|
|
# • Have a dedicated IP on the eth1 interface. The IP of the first machine (Server)
|
|
# will be 192.168.56.110, and the IP of the second machine (ServerWorker) will be
|
|
# 192.168.56.111.
|
|
# • Be able to connect with SSH on both machines with no password.
|
|
|
|
Vagrant.configure("2") do |config|
|
|
config.vagrant.plugins = []
|
|
|
|
config.vm.network "private_network", ip: "192.168.56.100"
|
|
config.vm.box = "debian/jessie64"
|
|
config.vm.provider "#{IOT_PROVIDER}" do |provider|
|
|
provider.cpus = 1
|
|
provider.memory = 1024
|
|
end
|
|
|
|
config.vm.define "#{IOT_LOGIN}S" do |server|
|
|
server.vm.hostname = "#{IOT_LOGIN}S"
|
|
server.vm.network "private_network", ip: "192.168.56.110"
|
|
end
|
|
|
|
config.vm.define "#{IOT_LOGIN}SW" do |serverworker|
|
|
serverworker.vm.hostname = "#{IOT_LOGIN}SW"
|
|
serverworker.vm.network "private_network", ip: "192.168.56.111"
|
|
end
|
|
end
|