-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathVagrantfile.template
46 lines (39 loc) · 1.86 KB
/
Vagrantfile.template
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
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
# Every Vagrant development environment requires a box. You can search for
# boxes at https://vagrantcloud.com/search.
config.vm.box = "ubuntu/bionic64"
# resize hd, need a plugin vagrant-disksize, see https://github.com/sprotheroe/vagrant-disksize
config.disksize.size = "${config_vm_storage}GB"
# network options
config.vm.network "private_network", ip: "192.168.137.$HOSTIP"
# config.vm.network "private_network", type: "dhcp", auto_config: false
# config.vm.network "public_network"
# Create forwarded port mapping which allows access to a specific port
config.vm.network "forwarded_port", guest:80, host:8080, auto_correct: true
# for i in 31000..32768
# config.vm.network :forwarded_port, guest: i, host: i
# end
# Share an additional folder to the guest VM.
config.vm.synced_folder "data", "/home/ubuntu/data"
config.vm.synced_folder "config", "/home/ubuntu/config"
config.vm.synced_folder "templates", "/home/ubuntu/templates"
# Provider-specific configuration so you can fine-tune various
# backing providers for Vagrant. These expose provider-specific options.
config.vm.provider "virtualbox" do |vb|
# Customize the amount of memory on the VM:
vb.memory = "${config_vm_memory}"
vb.cpus = "${config_vm_cores}"
vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
vb.name = "$HOSTNAME"
end
config.vm.hostname = "$HOSTNAME"
# Enable provisioning with a shell script.
config.vm.provision "shell", inline: <<-SHELL
sudo apt-get update
sudo apt-get install -y git curl wget jq markdown nmap traceroute
git clone https://github.com/mc-b/lernmaas /opt/lernmaas
sudo su - ubuntu -c "cd /opt/lernmaas && bash -x services/cloud-init.sh"
SHELL
end