2025-09-25 19:10:39 +02:00

29 lines
1.1 KiB
Ruby

Vagrant.configure("2") do |config|
config.vm.define "vm" do |machine|
machine.vm.hostname = "vm"
machine.vm.box = "chavinje/fr-book-64"
config.vm.network "private_network", ip: "192.168.56.15"
machine.vm.provider :virtualbox do |v|
v.customize ["modifyvm", :id, "--name", "vm"]
v.customize ["modifyvm", :id, "--groups", "/PFE"]
v.customize ["modifyvm", :id, "--cpus", "2"]
v.customize ["modifyvm", :id, "--memory", 2*1024]
v.customize ["modifyvm", :id, "--natdnshostresolver1", "off"]
v.customize ["modifyvm", :id, "--natdnsproxy1", "off"]
end
# Provisionnement pour la configuration SSH
machine.vm.provision "shell", inline: <<-SHELL
sed -i 's/ChallengeResponseAuthentication no/ChallengeResponseAuthentication yes/g' /etc/ssh/sshd_config
sleep 3
service ssh restart
SHELL
# Installation des systèmes nécessaires
machine.vm.provision "shell", path: "scripts/install_sys.sh"
machine.vm.provision "shell", path: "scripts/install_web.sh"
# Copier et configurer le script de sauvegarde automatique
end
end