blob: bed8f3e9c7a1870101dad84798e35dae75b72071 [file] [log] [blame]
Pawel Wieczorekea8bc1a2019-06-27 16:46:28 +02001# -*- mode: ruby -*-
2# -*- coding: utf-8 -*-
3
4vm_memory = 2 * 1024
5vm_cpus = 1
6
7cluster = [
8 { name: 'master', hostname: 'master', ip: '172.17.0.100' },
9 { name: 'worker', hostname: 'worker', ip: '172.17.0.101' }
10]
11
12Vagrant.configure('2') do |config|
13 cluster.each do |node|
14 config.vm.define node[:name] do |config|
15 config.vm.box = "generic/ubuntu1604"
16 config.vm.hostname = node[:hostname]
17
18 config.vm.provider :virtualbox do |v|
19 v.name = node[:name]
20 v.memory = vm_memory
21 v.cpus = vm_cpus
22 end
23
24 config.vm.provider :libvirt do |v|
25 v.memory = vm_memory
26 v.cpus = vm_cpus
27 end
28
29 config.vm.network :private_network, ip: node[:ip]
30
31 if node[:name] == 'master'
32 config.vm.network "forwarded_port", guest: 8080, host: 8080
Pawel Wieczorek6bbff982019-07-14 17:04:53 +020033 config.vm.provision :shell, path: "../../tools/casablanca/imported/openstack-rancher.sh"
34 config.vm.provision :shell, path: "../../tools/casablanca/get_ranchercli.sh"
Pawel Wieczorekea8bc1a2019-06-27 16:46:28 +020035 end
36
37 if node[:name] == 'worker'
Pawel Wieczorek6bbff982019-07-14 17:04:53 +020038 config.vm.provision :shell, path: "../../tools/casablanca/imported/openstack-k8s-node.sh"
Pawel Wieczorekea8bc1a2019-06-27 16:46:28 +020039 end
40 end
41 end
42end