58 lines
1.6 KiB
Ruby
58 lines
1.6 KiB
Ruby
# -*- mode: ruby -*-
|
|
# vi: set ft=ruby :
|
|
|
|
Vagrant.configure("2") do |config|
|
|
config.vm.synced_folder ".", "/vagrant", disabled: true
|
|
|
|
config.vm.define "hmi" do |hmi|
|
|
hmi.vm.box = "generic/ubuntu1604"
|
|
hmi.vm.hostname = "hmi"
|
|
hmi.vm.network "private_network", ip: "192.168.1.11"
|
|
|
|
# Dependencies, Networking
|
|
hmi.vm.provision "shell", inline: <<-SHELL
|
|
apt-get update
|
|
apt-get install -y git
|
|
SHELL
|
|
|
|
# Installation
|
|
hmi.vm.provision "shell", privileged: false, inline: <<-SHELL
|
|
git clone https://github.com/ScadaBR/ScadaBR_Installer
|
|
cd ScadaBR_Installer && chmod +x install_scadabr.sh remove_scadabr.sh scadabr.sh
|
|
sudo ./install_scadabr.sh silent
|
|
SHELL
|
|
|
|
# Run
|
|
hmi.vm.provision "shell", privileged: false, run: "always", inline: <<-SHELL
|
|
sudo bash /opt/ScadaBR/scadabr.sh start
|
|
SHELL
|
|
|
|
end
|
|
|
|
config.vm.define "plc" do |plc|
|
|
plc.vm.box = "debian/bullseye64"
|
|
plc.vm.hostname = "plc"
|
|
plc.vm.network "private_network", ip: "192.168.1.100"
|
|
|
|
# USB passthrough, may need changing
|
|
plc.vm.provider :libvirt do |libvirt|
|
|
libvirt.usb :bus => '1', :device => '1'
|
|
libvirt.usb :bus => '2', :device => '1'
|
|
end
|
|
|
|
# Dependencies, Networking
|
|
plc.vm.provision "shell", inline: <<-SHELL
|
|
apt-get update
|
|
apt-get install -y git net-tools
|
|
SHELL
|
|
|
|
# Installation
|
|
plc.vm.provision "shell", privileged: false, inline: <<-SHELL
|
|
git clone https://github.com/thiagoralves/OpenPLC_v3.git
|
|
cd ~/OpenPLC_v3
|
|
./install.sh linux
|
|
sudo systemctl start openplc
|
|
SHELL
|
|
end
|
|
|
|
end
|