-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVagrantfile
More file actions
60 lines (46 loc) · 2.01 KB
/
Copy pathVagrantfile
File metadata and controls
60 lines (46 loc) · 2.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
# Configurações globais
config.vm.box = "debian/bookworm64" # Versão 12 Estável
# Desativa a atualização automática errática do plugin vbguest
# Isso evita que ele tente instalar headers específicos que podem não existir mais no repo.
if Vagrant.has_plugin?("vagrant-vbguest")
config.vbguest.auto_update = false
end
config.vm.define "debian-general" do |general|
general.vm.hostname = "devops.domain.local"
# Melhores Práticas: auto_correct evita falhas se a porta 80 estiver ocupada no host
general.vm.network "forwarded_port", guest: 80, host: 8080, auto_correct: true
general.vm.network "forwarded_port", guest: 443, host: 8443, auto_correct: true
# Rede Interna Isolada (grupolimajr-net)
general.vm.network "private_network",
ip: "192.168.56.248",
virtualbox__intnet: "grupolimajr-net"
general.vm.provider "virtualbox" do |vb|
vb.memory = 2048
vb.cpus = 2
vb.name = "devops"
# Desabilitar interface gráfica (headless mode)
vb.gui = false
# Sincronização de tempo agressiva para evitar Clock Drift
vb.customize ["guestproperty", "set", :id, "/VirtualBox/GuestAdd/VBoxService/--timesync-set-threshold", 1000]
end
# PREPARAÇÃO: Garante que o sistema esteja atualizado ANTES do setup.sh
# O uso do linux-headers-amd64 (meta-pacote) evita o erro de "package not found"
general.vm.provision "shell", inline: <<-SHELL
echo "Limpando e atualizando repositórios..."
apt-get update
apt-get install -y linux-headers-amd64 build-essential dkms
SHELL
# PROVISIONAMENTO PRINCIPAL: Executa o script setup.sh
general.vm.provision "shell", path: "setup.sh"
end
# Cliente de Testes
config.vm.define "host-client" do |c|
c.vm.hostname = "client.grupolimajr.com.br"
c.vm.network "private_network",
type: "dhcp",
virtualbox__intnet: "grupolimajr-net"
end
end