-
Notifications
You must be signed in to change notification settings - Fork 0
/
Vagrantfile
63 lines (53 loc) · 1.97 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
# coding: utf-8
# copyright Utrecht University
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Configuration variables.
VAGRANTFILE_API_VERSION = "2"
# Set BOX to bento/centos-7 for CentOS 7, or to almalinux/8 for Alma Linux 8
BOX = 'almalinux/8'
GUI = false
CPU = 2
RAM = 2048
DOMAIN = ".ckan.test"
NETWORK = "192.168.70."
NETMASK = "255.255.255.0"
HOSTS = {
"ilab-catalog" => [NETWORK+"10", 2, 2048, GUI, BOX],
}
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.ssh.insert_key = false
HOSTS.each do | (name, cfg) |
ipaddr, cpu, ram, gui, box = cfg
config.vm.define name do |machine|
machine.vm.box = box
machine.vm.provider "virtualbox" do |vbox|
vbox.gui = gui
vbox.cpus = cpu
vbox.memory = ram
vbox.name = name
vbox.customize ["guestproperty", "set", :id, "/VirtualBox/GuestAdd/VBoxService/--timesync-set-threshold", 10000]
end
machine.vm.hostname = name + DOMAIN
machine.vm.network 'private_network', ip: ipaddr, netmask: NETMASK
machine.vm.synced_folder ".", "/vagrant", disabled: true
machine.vm.provision "shell",
inline: "sudo timedatectl set-timezone Europe/Amsterdam"
end
end
# Provision controller for Ansible on Windows host.
if Vagrant::Util::Platform.windows? then
config.vm.define "ilab-catalog-controller" do |controller|
controller.vm.provider "virtualbox" do |vbox|
vbox.customize ["guestproperty", "set", :id, "/VirtualBox/GuestAdd/VBoxService/--timesync-set-threshold", 10000]
end
controller.vm.box = BOX
controller.vm.hostname = "ilab-catalog-controller"
controller.vm.network :private_network, ip: "192.168.70.5", netmask: NETMASK
controller.vm.synced_folder ".", "/vagrant", disabled: true
controller.vm.provision "shell", privileged: false, path: "vagrant/provision_controller.sh"
controller.vm.provision "shell",
inline: "sudo timedatectl set-timezone Europe/Amsterdam"
end
end
end