improve Vagrantfile
This commit is contained in:
parent
7e46c3cafc
commit
02254a5905
20
Vagrantfile
vendored
20
Vagrantfile
vendored
|
@ -1,8 +1,6 @@
|
|||
# -*- mode: ruby -*-
|
||||
# vi: set ft=ruby :
|
||||
|
||||
Vagrant::DEFAULT_SERVER_URL.replace('https://vagrantcloud.com')
|
||||
|
||||
# Load ~/.VagrantFile if exist, permit local config provider
|
||||
vagrantfile = File.join("#{Dir.home}", '.VagrantFile')
|
||||
load File.expand_path(vagrantfile) if File.exists?(vagrantfile)
|
||||
|
@ -11,16 +9,26 @@ Vagrant.configure('2') do |config|
|
|||
config.vm.synced_folder "./", "/vagrant", type: "rsync", rsync__exclude: [ '.vagrant', '.git' ]
|
||||
config.ssh.shell="/bin/sh"
|
||||
|
||||
$install = <<SCRIPT
|
||||
DEBIAN_FRONTEND=noninteractive apt-get -yq install iptables
|
||||
deps = <<SCRIPT
|
||||
DEBIAN_FRONTEND=noninteractive apt-get -yq install iptables
|
||||
SCRIPT
|
||||
|
||||
install = <<SCRIPT
|
||||
ln -fs /vagrant/minifirewall /etc/init.d/minifirewall
|
||||
ln -fs /vagrant/minifirewall.conf /etc/default/minifirewall
|
||||
mkdir -p /etc/minifirewall.d
|
||||
SCRIPT
|
||||
|
||||
post = <<SCRIPT
|
||||
sed -i "s|^TRUSTEDIPS='|TRUSTEDIPS='192.168.121.0/24 |" /etc/default/minifirewall
|
||||
SCRIPT
|
||||
|
||||
config.vm.define "minifirewall" do |node|
|
||||
node.vm.hostname = "minifirewall"
|
||||
node.vm.box = "debian/stretch64"
|
||||
config.vm.provision "install", type: "shell", :inline => $install
|
||||
node.vm.box = "debian/bookworm64"
|
||||
config.vm.provision "deps", type: "shell", inline: deps
|
||||
config.vm.provision "install", type: "shell", inline: install
|
||||
config.vm.provision "post", type: "shell", inline: post
|
||||
end
|
||||
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue