blob: 4898d79526a7948f4ac8d7ca2221eedbb5a87e98 [file] [log] [blame]
Pawel Wieczorekea8bc1a2019-06-27 16:46:28 +02001# -*- mode: ruby -*-
2# -*- coding: utf-8 -*-
3
Pawel Wieczoreke377eb02019-07-15 18:10:02 +02004host_ip = "192.168.121.1"
5
Pawel Wieczorekea8bc1a2019-06-27 16:46:28 +02006vm_memory = 2 * 1024
7vm_cpus = 1
8
9cluster = [
10 { name: 'master', hostname: 'master', ip: '172.17.0.100' },
11 { name: 'worker', hostname: 'worker', ip: '172.17.0.101' }
12]
13
14Vagrant.configure('2') do |config|
15 cluster.each do |node|
16 config.vm.define node[:name] do |config|
17 config.vm.box = "generic/ubuntu1604"
18 config.vm.hostname = node[:hostname]
19
20 config.vm.provider :virtualbox do |v|
21 v.name = node[:name]
22 v.memory = vm_memory
23 v.cpus = vm_cpus
24 end
25
26 config.vm.provider :libvirt do |v|
27 v.memory = vm_memory
28 v.cpus = vm_cpus
29 end
30
31 config.vm.network :private_network, ip: node[:ip]
Pawel Wieczoreke377eb02019-07-15 18:10:02 +020032 config.vm.provision :shell, inline: "echo nameserver #{host_ip} | resolvconf -a eth0.inet"
Pawel Wieczorekea8bc1a2019-06-27 16:46:28 +020033
34 if node[:name] == 'master'
35 config.vm.network "forwarded_port", guest: 8080, host: 8080
Pawel Wieczorek6bbff982019-07-14 17:04:53 +020036 config.vm.provision :shell, path: "../../tools/casablanca/imported/openstack-rancher.sh"
37 config.vm.provision :shell, path: "../../tools/casablanca/get_ranchercli.sh"
Pawel Wieczorekea8bc1a2019-06-27 16:46:28 +020038 end
39
40 if node[:name] == 'worker'
Pawel Wieczorek6bbff982019-07-14 17:04:53 +020041 config.vm.provision :shell, path: "../../tools/casablanca/imported/openstack-k8s-node.sh"
Pawel Wieczorekea8bc1a2019-06-27 16:46:28 +020042 end
43 end
44 end
45end