-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVagrantfile
84 lines (68 loc) · 2.54 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Variables
OPEN5GS_IPv4_ADDR = "192.168.56.10"
UERANSIM_IPv4_ADDR = "192.168.56.20"
TAC = "2"
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
# https://docs.vagrantup.com.
# Common configs for both VMs are listed here
config.vm.box = "bento/ubuntu-22.04"
config.vm.box_version = "202309.08.0 "
config.vm.box_check_update = false
# VM #1: OPEN5GS 5G core network (All-in-one)
config.vm.define "open5gs" do |open5gs|
open5gs.vm.network "private_network", ip: OPEN5GS_IPv4_ADDR
# open5gs.vm.network "public_network"
open5gs.vm.provider "virtualbox" do |vb|
# Customize the amount of cpu & memory on the VM:
vb.memory = "4096"
vb.cpus = "2"
end
# Use :ansible_local as the provisioner of guest
# Open5gs machine provisioner that is run only during initial machine provisioning
open5gs.vm.provision :ansible_local do |ansible|
# activate privilege escalation for ansible
ansible.become = true
ansible.playbook = "ansible/bootstrap.yaml"
ansible.extra_vars = {
open5gs_ipv4_addr: OPEN5GS_IPv4_ADDR,
open5gs_tac: TAC
}
ansible.verbose = true
end
# Open5gs machine provisioner for every up/reload
open5gs.vm.provision :ansible_local, run: "always" do |ansible|
# activate privilege escalation for ansible
ansible.become = true
ansible.playbook = "ansible/always.yaml"
end
end
# VM#2: UERANSIM as our UE & RAN (gNB) Simulator
config.vm.define "ueransim" do |ueransim|
ueransim.vm.network "private_network", ip: UERANSIM_IPv4_ADDR
ueransim.vm.provider "virtualbox" do |vb|
# Customize the amount of cpu & memory on the VM:
vb.memory = "2048"
vb.cpus = "1"
end
# Use :ansible_local as the provisioner of guest
ueransim.vm.provision :ansible_local do |ansible|
# activate privilege escalation for ansible
ansible.become = true
ansible.playbook = "ansible/bootstrap.yaml"
ansible.extra_vars = {
open5gs_ipv4_addr: OPEN5GS_IPv4_ADDR,
ueransim_gnb_ipv4_addr: UERANSIM_IPv4_ADDR,
open5gs_tac: TAC
}
ansible.verbose = true
end
end
end