Zack Williams | a1f5508 | 2017-02-28 22:41:36 -0700 | [diff] [blame] | 1 | # -*- mode: ruby -*- |
| 2 | # vi: set ft=ruby : |
| 3 | # |
Zack Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 4 | # opencloud Vagrantfile |
| 5 | |
Zack Williams | a1f5508 | 2017-02-28 22:41:36 -0700 | [diff] [blame] | 6 | require 'yaml' |
Zack Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 7 | settings = YAML.load_file('genconfig/config.yml') |
Zack Williams | a1f5508 | 2017-02-28 22:41:36 -0700 | [diff] [blame] | 8 | |
| 9 | Vagrant.configure(2) do |config| |
| 10 | |
Zack Williams | 82f24ca | 2017-12-30 13:53:46 -0700 | [diff] [blame] | 11 | config.vm.box = settings["vagrant_box"] |
Zack Williams | a1f5508 | 2017-02-28 22:41:36 -0700 | [diff] [blame] | 12 | |
| 13 | config.vm.define "head1" do |h| |
| 14 | h.vm.hostname = "head1" |
Zack Williams | ccf0bb1 | 2018-01-02 14:33:57 -0700 | [diff] [blame^] | 15 | h.vm.network "forwarded_port", guest: 80, host: 8080, host_ip: '0.0.0.0' |
Zack Williams | a1f5508 | 2017-02-28 22:41:36 -0700 | [diff] [blame] | 16 | h.vm.provider :libvirt do |v| |
Zack Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 17 | v.memory = settings['head_vm_mem'] |
| 18 | v.cpus = settings['head_vm_cpu'] |
Zack Williams | a1f5508 | 2017-02-28 22:41:36 -0700 | [diff] [blame] | 19 | v.machine_virtual_size = 100 |
Zack Williams | 0a7ef16 | 2017-07-18 18:15:26 -0700 | [diff] [blame] | 20 | v.management_network_name = settings['vm_public_network_name'] # public network |
| 21 | v.management_network_address = settings['vm_public_network_cidr'] |
Zack Williams | a1f5508 | 2017-02-28 22:41:36 -0700 | [diff] [blame] | 22 | end |
| 23 | h.vm.network "private_network", # management network, eth1 |
| 24 | ip: "0.1.1.0", # not used, ignore |
| 25 | auto_config: false, |
Zack Williams | 0a7ef16 | 2017-07-18 18:15:26 -0700 | [diff] [blame] | 26 | libvirt__network_name: settings['vm_management_network_name'], |
Zack Williams | a1f5508 | 2017-02-28 22:41:36 -0700 | [diff] [blame] | 27 | libvirt__forward_mode: "none", |
| 28 | libvirt__dhcp_enabled: false |
| 29 | end |
| 30 | |
| 31 | config.vm.define "compute1" do |c| |
| 32 | c.vm.hostname = "compute1" |
| 33 | c.vm.provider :libvirt do |v| |
Zack Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 34 | v.memory = settings['compute_vm_mem'] |
Zack Williams | 0a7ef16 | 2017-07-18 18:15:26 -0700 | [diff] [blame] | 35 | v.cpus = settings['compute_vm_cpu'] |
Zack Williams | a1f5508 | 2017-02-28 22:41:36 -0700 | [diff] [blame] | 36 | v.machine_virtual_size = 50 |
| 37 | v.nested = true |
Zack Williams | 0a7ef16 | 2017-07-18 18:15:26 -0700 | [diff] [blame] | 38 | v.management_network_name = settings['vm_public_network_name'] # public network |
| 39 | v.management_network_address = settings['vm_public_network_cidr'] |
Zack Williams | a1f5508 | 2017-02-28 22:41:36 -0700 | [diff] [blame] | 40 | end |
| 41 | c.vm.network "private_network", # management network, eth1 |
| 42 | ip: "0.1.1.0", |
| 43 | auto_config: false, |
Zack Williams | 0a7ef16 | 2017-07-18 18:15:26 -0700 | [diff] [blame] | 44 | libvirt__network_name: settings['vm_management_network_name'], |
Zack Williams | a1f5508 | 2017-02-28 22:41:36 -0700 | [diff] [blame] | 45 | libvirt__forward_mode: "none", |
| 46 | libvirt__dhcp_enabled: false |
| 47 | end |
| 48 | |
| 49 | config.vm.define "compute2" do |c| |
| 50 | c.vm.hostname = "compute2" |
| 51 | c.vm.provider :libvirt do |v| |
Zack Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 52 | v.memory = settings['compute_vm_mem'] |
Zack Williams | 0a7ef16 | 2017-07-18 18:15:26 -0700 | [diff] [blame] | 53 | v.cpus = settings['compute_vm_cpu'] |
Zack Williams | a1f5508 | 2017-02-28 22:41:36 -0700 | [diff] [blame] | 54 | v.machine_virtual_size = 50 |
| 55 | v.nested = true |
Zack Williams | 0a7ef16 | 2017-07-18 18:15:26 -0700 | [diff] [blame] | 56 | v.management_network_name = settings['vm_public_network_name'] # public network |
| 57 | v.management_network_address = settings['vm_public_network_cidr'] |
Zack Williams | a1f5508 | 2017-02-28 22:41:36 -0700 | [diff] [blame] | 58 | end |
| 59 | c.vm.network "private_network", # management network, eth1 |
| 60 | ip: "0.1.1.0", |
| 61 | auto_config: false, |
Zack Williams | 0a7ef16 | 2017-07-18 18:15:26 -0700 | [diff] [blame] | 62 | libvirt__network_name: settings['vm_management_network_name'], |
Zack Williams | a1f5508 | 2017-02-28 22:41:36 -0700 | [diff] [blame] | 63 | libvirt__forward_mode: "none", |
| 64 | libvirt__dhcp_enabled: false |
| 65 | end |
| 66 | |
| 67 | end |
Zack Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 68 | |