Zack Williams | a7104e3 | 2018-01-03 10:55:26 -0700 | [diff] [blame] | 1 | # -*- mode: ruby -*- |
| 2 | # vi: set ft=ruby : |
| 3 | # |
| 4 | # controlkube Scenario Vagrantfile |
| 5 | |
| 6 | require 'yaml' |
| 7 | settings = YAML.load_file('genconfig/config.yml') |
| 8 | |
| 9 | Vagrant.configure("2") do |config| |
| 10 | |
| 11 | config.vm.box = settings["vagrant_box"] |
| 12 | |
| 13 | config.vm.synced_folder '.', '/vagrant', disabled: true |
| 14 | |
| 15 | # set the headnode VM |
| 16 | config.vm.define "head1" do |h| |
| 17 | h.vm.hostname = "head1" |
| 18 | h.vm.network "forwarded_port", guest: 80, host: 8080, host_ip: '0.0.0.0' |
| 19 | h.vm.provider :virtualbox do |vb| |
| 20 | vb.memory = settings['head_vm_mem'] |
| 21 | vb.cpus = settings['head_vm_cpu'] |
| 22 | vb.linked_clone = true |
| 23 | end |
| 24 | h.vm.provider :libvirt do |v, override| |
| 25 | v.memory = settings['head_vm_mem'] |
| 26 | v.cpus = settings['head_vm_cpu'] |
| 27 | end |
| 28 | h.vm.network "private_network", # management network, eth1 |
Zack Williams | 9f42b97 | 2018-01-10 15:05:35 -0700 | [diff] [blame] | 29 | ip: "0.1.0.0", # not used, ignore |
Zack Williams | a7104e3 | 2018-01-03 10:55:26 -0700 | [diff] [blame] | 30 | auto_config: false, |
| 31 | virtualbox__intnet: settings['vm_management_network_name'], |
| 32 | libvirt__network_name: settings['vm_management_network_name'], |
| 33 | libvirt__forward_mode: "none", |
| 34 | libvirt__dhcp_enabled: false |
Zack Williams | 9f42b97 | 2018-01-10 15:05:35 -0700 | [diff] [blame] | 35 | h.vm.network "private_network", # public network, eth2 |
| 36 | ip: "0.2.0.0", # not used, ignore |
| 37 | auto_config: false, |
| 38 | virtualbox__intnet: settings['vm_public_network_name'], |
| 39 | libvirt__network_name: settings['vm_public_network_name'], |
| 40 | libvirt__forward_mode: "none", |
| 41 | libvirt__dhcp_enabled: false |
Zack Williams | a7104e3 | 2018-01-03 10:55:26 -0700 | [diff] [blame] | 42 | end |
| 43 | |
| 44 | config.vm.define "compute1" do |c| |
| 45 | c.vm.hostname = "compute1" |
| 46 | c.vm.provider :virtualbox do |vb| |
| 47 | vb.memory = settings['compute_vm_mem'] |
| 48 | vb.cpus = settings['compute_vm_cpu'] |
| 49 | vb.linked_clone = true |
| 50 | end |
| 51 | c.vm.provider :libvirt do |v| |
| 52 | v.memory = settings['compute_vm_mem'] |
| 53 | v.cpus = settings['compute_vm_cpu'] |
| 54 | end |
| 55 | c.vm.network "private_network", # management network, eth1 |
Zack Williams | 9f42b97 | 2018-01-10 15:05:35 -0700 | [diff] [blame] | 56 | ip: "0.1.0.0", |
Zack Williams | a7104e3 | 2018-01-03 10:55:26 -0700 | [diff] [blame] | 57 | auto_config: false, |
| 58 | virtualbox__intnet: settings['vm_management_network_name'], |
| 59 | libvirt__network_name: settings['vm_management_network_name'], |
| 60 | libvirt__forward_mode: "none", |
| 61 | libvirt__dhcp_enabled: false |
Zack Williams | 9f42b97 | 2018-01-10 15:05:35 -0700 | [diff] [blame] | 62 | c.vm.network "private_network", # public network, eth2 |
| 63 | ip: "0.2.0.0", # not used, ignore |
| 64 | auto_config: false, |
| 65 | virtualbox__intnet: settings['vm_public_network_name'], |
| 66 | libvirt__network_name: settings['vm_public_network_name'], |
| 67 | libvirt__forward_mode: "none", |
| 68 | libvirt__dhcp_enabled: false |
Zack Williams | a7104e3 | 2018-01-03 10:55:26 -0700 | [diff] [blame] | 69 | end |
| 70 | |
| 71 | config.vm.define "compute2" do |c| |
| 72 | c.vm.hostname = "compute2" |
| 73 | c.vm.provider :virtualbox do |vb| |
| 74 | vb.memory = settings['compute_vm_mem'] |
| 75 | vb.cpus = settings['compute_vm_cpu'] |
| 76 | vb.linked_clone = true |
| 77 | end |
| 78 | c.vm.provider :libvirt do |v| |
| 79 | v.memory = settings['compute_vm_mem'] |
| 80 | v.cpus = settings['compute_vm_cpu'] |
| 81 | end |
| 82 | c.vm.network "private_network", # management network, eth1 |
Zack Williams | 9f42b97 | 2018-01-10 15:05:35 -0700 | [diff] [blame] | 83 | ip: "0.1.0.0", |
Zack Williams | a7104e3 | 2018-01-03 10:55:26 -0700 | [diff] [blame] | 84 | auto_config: false, |
| 85 | virtualbox__intnet: settings['vm_management_network_name'], |
| 86 | libvirt__network_name: settings['vm_management_network_name'], |
| 87 | libvirt__forward_mode: "none", |
| 88 | libvirt__dhcp_enabled: false |
Zack Williams | 9f42b97 | 2018-01-10 15:05:35 -0700 | [diff] [blame] | 89 | c.vm.network "private_network", # public network, eth2 |
| 90 | ip: "0.2.0.0", # not used, ignore |
| 91 | auto_config: false, |
| 92 | virtualbox__intnet: settings['vm_public_network_name'], |
| 93 | libvirt__network_name: settings['vm_public_network_name'], |
| 94 | libvirt__forward_mode: "none", |
| 95 | libvirt__dhcp_enabled: false |
Zack Williams | a7104e3 | 2018-01-03 10:55:26 -0700 | [diff] [blame] | 96 | end |
| 97 | end |
| 98 | |