-
Notifications
You must be signed in to change notification settings - Fork 0
/
Vagrantfile
57 lines (51 loc) · 1.64 KB
/
Vagrantfile
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
# -*- mode: ruby -*-
# vi: set ft=ruby :
$network_interface = `sudo iw dev | awk '$1=="Interface"{print $2}'`.strip
$subnet = `ip -4 addr show $network_interface | awk '/inet 192.168./{split($2,a,"."); print a[3]}'`.strip
Vagrant.configure("2") do |config|
# LAMP server
config.vm.define "gshortener" do |gshortener|
gshortener.vm.box = "eurolinux-vagrant/rocky-9"
gshortener.vm.hostname = "gshortener.pusula.local"
gshortener.vm.network "public_network",
bridge: $network_interface,
ip: "192.168.#{$subnet}.21",
dhcp: true
gshortener.vm.provider "vmware_desktop" do |v|
v.gui = true
v.memory = 2048
v.cpus = 2
end
gshortener.vm.provision "ansible" do |ansible|
ansible.limit = "all"
ansible.playbook = "ansible/gshortener/gshortener.yml"
end
end
# Jenkins server
config.vm.define "jenkins" do |jenkins|
jenkins.vm.box = "eurolinux-vagrant/rocky-9"
jenkins.vm.hostname = "jenkins01.pusula.local"
jenkins.vm.network "public_network",
bridge: $network_interface,
ip: "192.168.#{$subnet}.22",
dhcp: true
jenkins.vm.synced_folder ".", "/vagrant"
jenkins.vm.provider "vmware_desktop" do |v|
v.gui = true
v.memory = 2048
v.cpus = 2
end
jenkins.vm.provision "ansible" do |ansible|
ansible.limit = "all"
ansible.playbook = "ansible/jenkins/jenkins.yml"
end
end
# Configure global settings for all VMs
config.vm.provider "vmware_desktop" do |v|
v.whitelist_verified = true
v.vmx["ethernet0.virtualDev"] = "vmxnet3"
v.vmx["ethernet1.virtualDev"] = "vmxnet3"
v.memory = 2048
v.cpus = 2
end
end