1-
...
Script for the master
2- Script for the minion1
3- Script for the minion2
https://www.vagrantup.com/docs/provisioning/shell.html
1-
...
Script for the master
edit Vagrantfile:
$script = <<SCRIPT
sudo -i
ip link set enp0s3 down
ip route add default via 192.168.0.1
sed -i '$ d' /etc/resolv.conf
echo "nameserver 8.8.8.8" >> /etc/resolv.conf
exit
SCRIPT
Vagrant.configure("2") do |config|
config.vm.box = "bento/ubuntu-16.04"
config.vm.network "public_network", bridge: "Intel(R) Ethernet Connection I219-LM" , ip: "192.168.0.101"
config.vm.hostname = "master"
...
config.vm.provision "shell", inline: $script
end
2- Script for the minion1
$script = <<SCRIPT
sudo -i
ip link set enp0s3 down
ip route add default via 192.168.0.1
sed -i '$ d' /etc/resolv.conf
echo "nameserver 8.8.8.8" >> /etc/resolv.conf
exit
SCRIPT
Vagrant.configure("2") do |config|
config.vm.box = "bento/ubuntu-16.04"
config.vm.network "public_network", bridge: "Intel(R) Ethernet Connection I219-LM" , ip: "192.168.0.102"
config.vm.hostname = "master"
config.vm.provision
...
"shell",
...
inline:
...
$script
end