Zack Williams | a1f5508 | 2017-02-28 22:41:36 -0700 | [diff] [blame] | 1 | # -*- mode: ruby -*- |
| 2 | # vi: set ft=ruby : |
| 3 | # |
Zack Williams | 9f42b97 | 2018-01-10 15:05:35 -0700 | [diff] [blame] | 4 | # preppedpod Vagrantfile |
Zack Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 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 | a1f5508 | 2017-02-28 22:41:36 -0700 | [diff] [blame] | 20 | end |
| 21 | h.vm.network "private_network", # management network, eth1 |
Zack Williams | 9f42b97 | 2018-01-10 15:05:35 -0700 | [diff] [blame] | 22 | adapter: 1, |
| 23 | ip: "0.1.0.0", # not used, ignore |
Zack Williams | a1f5508 | 2017-02-28 22:41:36 -0700 | [diff] [blame] | 24 | auto_config: false, |
Zack Williams | 9f42b97 | 2018-01-10 15:05:35 -0700 | [diff] [blame] | 25 | virtualbox__intnet: settings['vm_management_network_name'], |
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 |
Zack Williams | 9f42b97 | 2018-01-10 15:05:35 -0700 | [diff] [blame] | 29 | h.vm.network "private_network", # public network, eth2 |
| 30 | adapter: 2, |
| 31 | ip: "0.2.0.0", # not used, ignore |
| 32 | auto_config: false, |
| 33 | virtualbox__intnet: settings['vm_public_network_name'], |
| 34 | libvirt__network_name: settings['vm_public_network_name'], |
| 35 | libvirt__forward_mode: "none", |
| 36 | libvirt__dhcp_enabled: false |
Zack Williams | a1f5508 | 2017-02-28 22:41:36 -0700 | [diff] [blame] | 37 | end |
| 38 | |
| 39 | config.vm.define "compute1" do |c| |
| 40 | c.vm.hostname = "compute1" |
| 41 | c.vm.provider :libvirt do |v| |
Zack Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 42 | v.memory = settings['compute_vm_mem'] |
Zack Williams | 0a7ef16 | 2017-07-18 18:15:26 -0700 | [diff] [blame] | 43 | v.cpus = settings['compute_vm_cpu'] |
Zack Williams | a1f5508 | 2017-02-28 22:41:36 -0700 | [diff] [blame] | 44 | v.machine_virtual_size = 50 |
| 45 | v.nested = true |
Zack Williams | a1f5508 | 2017-02-28 22:41:36 -0700 | [diff] [blame] | 46 | end |
| 47 | c.vm.network "private_network", # management network, eth1 |
Zack Williams | 9f42b97 | 2018-01-10 15:05:35 -0700 | [diff] [blame] | 48 | adapter: 1, |
| 49 | ip: "0.1.0.0", |
Zack Williams | a1f5508 | 2017-02-28 22:41:36 -0700 | [diff] [blame] | 50 | auto_config: false, |
Zack Williams | 9f42b97 | 2018-01-10 15:05:35 -0700 | [diff] [blame] | 51 | virtualbox__intnet: settings['vm_management_network_name'], |
Zack Williams | 0a7ef16 | 2017-07-18 18:15:26 -0700 | [diff] [blame] | 52 | libvirt__network_name: settings['vm_management_network_name'], |
Zack Williams | a1f5508 | 2017-02-28 22:41:36 -0700 | [diff] [blame] | 53 | libvirt__forward_mode: "none", |
| 54 | libvirt__dhcp_enabled: false |
Zack Williams | 9f42b97 | 2018-01-10 15:05:35 -0700 | [diff] [blame] | 55 | c.vm.network "private_network", # public network, eth2 |
| 56 | adapter: 2, |
| 57 | ip: "0.2.0.0", # not used, ignore |
| 58 | auto_config: false, |
| 59 | virtualbox__intnet: settings['vm_public_network_name'], |
| 60 | libvirt__network_name: settings['vm_public_network_name'], |
| 61 | libvirt__forward_mode: "none", |
| 62 | libvirt__dhcp_enabled: false |
Zack Williams | a1f5508 | 2017-02-28 22:41:36 -0700 | [diff] [blame] | 63 | end |
| 64 | |
| 65 | config.vm.define "compute2" do |c| |
| 66 | c.vm.hostname = "compute2" |
| 67 | c.vm.provider :libvirt do |v| |
Zack Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 68 | v.memory = settings['compute_vm_mem'] |
Zack Williams | 0a7ef16 | 2017-07-18 18:15:26 -0700 | [diff] [blame] | 69 | v.cpus = settings['compute_vm_cpu'] |
Zack Williams | a1f5508 | 2017-02-28 22:41:36 -0700 | [diff] [blame] | 70 | v.machine_virtual_size = 50 |
| 71 | v.nested = true |
Zack Williams | a1f5508 | 2017-02-28 22:41:36 -0700 | [diff] [blame] | 72 | end |
| 73 | c.vm.network "private_network", # management network, eth1 |
Zack Williams | 9f42b97 | 2018-01-10 15:05:35 -0700 | [diff] [blame] | 74 | adapter: 1, |
| 75 | ip: "0.1.0.0", |
Zack Williams | a1f5508 | 2017-02-28 22:41:36 -0700 | [diff] [blame] | 76 | auto_config: false, |
Zack Williams | 9f42b97 | 2018-01-10 15:05:35 -0700 | [diff] [blame] | 77 | virtualbox__intnet: settings['vm_management_network_name'], |
Zack Williams | 0a7ef16 | 2017-07-18 18:15:26 -0700 | [diff] [blame] | 78 | libvirt__network_name: settings['vm_management_network_name'], |
Zack Williams | a1f5508 | 2017-02-28 22:41:36 -0700 | [diff] [blame] | 79 | libvirt__forward_mode: "none", |
| 80 | libvirt__dhcp_enabled: false |
Zack Williams | 9f42b97 | 2018-01-10 15:05:35 -0700 | [diff] [blame] | 81 | c.vm.network "private_network", # public network, eth2 |
| 82 | adapter: 2, |
| 83 | ip: "0.2.0.0", # not used, ignore |
| 84 | auto_config: false, |
| 85 | virtualbox__intnet: settings['vm_public_network_name'], |
| 86 | libvirt__network_name: settings['vm_public_network_name'], |
| 87 | libvirt__forward_mode: "none", |
| 88 | libvirt__dhcp_enabled: false |
Zack Williams | a1f5508 | 2017-02-28 22:41:36 -0700 | [diff] [blame] | 89 | end |
| 90 | |
| 91 | end |
Zack Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 92 | |