blob: b74d57495942d71c305126797d6c09f0b1798630 [file] [log] [blame]
Zack Williamsa1f55082017-02-28 22:41:36 -07001# -*- mode: ruby -*-
2# vi: set ft=ruby :
3#
Zack Williams9f42b972018-01-10 15:05:35 -07004# preppedpod Vagrantfile
Zack Williamsce63eb02017-02-28 10:46:22 -07005
Zack Williamsa1f55082017-02-28 22:41:36 -07006require 'yaml'
Zack Williamsce63eb02017-02-28 10:46:22 -07007settings = YAML.load_file('genconfig/config.yml')
Zack Williamsa1f55082017-02-28 22:41:36 -07008
9Vagrant.configure(2) do |config|
10
Zack Williams82f24ca2017-12-30 13:53:46 -070011 config.vm.box = settings["vagrant_box"]
Zack Williamsa1f55082017-02-28 22:41:36 -070012
13 config.vm.define "head1" do |h|
14 h.vm.hostname = "head1"
Zack Williamsccf0bb12018-01-02 14:33:57 -070015 h.vm.network "forwarded_port", guest: 80, host: 8080, host_ip: '0.0.0.0'
Zack Williamsa1f55082017-02-28 22:41:36 -070016 h.vm.provider :libvirt do |v|
Zack Williamsce63eb02017-02-28 10:46:22 -070017 v.memory = settings['head_vm_mem']
18 v.cpus = settings['head_vm_cpu']
Zack Williamsa1f55082017-02-28 22:41:36 -070019 v.machine_virtual_size = 100
Zack Williamsa1f55082017-02-28 22:41:36 -070020 end
21 h.vm.network "private_network", # management network, eth1
Zack Williams9f42b972018-01-10 15:05:35 -070022 adapter: 1,
23 ip: "0.1.0.0", # not used, ignore
Zack Williamsa1f55082017-02-28 22:41:36 -070024 auto_config: false,
Zack Williams9f42b972018-01-10 15:05:35 -070025 virtualbox__intnet: settings['vm_management_network_name'],
Zack Williams0a7ef162017-07-18 18:15:26 -070026 libvirt__network_name: settings['vm_management_network_name'],
Zack Williamsa1f55082017-02-28 22:41:36 -070027 libvirt__forward_mode: "none",
28 libvirt__dhcp_enabled: false
Zack Williams9f42b972018-01-10 15:05:35 -070029 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 Williamsa1f55082017-02-28 22:41:36 -070037 end
38
39 config.vm.define "compute1" do |c|
40 c.vm.hostname = "compute1"
41 c.vm.provider :libvirt do |v|
Zack Williamsce63eb02017-02-28 10:46:22 -070042 v.memory = settings['compute_vm_mem']
Zack Williams0a7ef162017-07-18 18:15:26 -070043 v.cpus = settings['compute_vm_cpu']
Zack Williamsa1f55082017-02-28 22:41:36 -070044 v.machine_virtual_size = 50
45 v.nested = true
Zack Williamsa1f55082017-02-28 22:41:36 -070046 end
47 c.vm.network "private_network", # management network, eth1
Zack Williams9f42b972018-01-10 15:05:35 -070048 adapter: 1,
49 ip: "0.1.0.0",
Zack Williamsa1f55082017-02-28 22:41:36 -070050 auto_config: false,
Zack Williams9f42b972018-01-10 15:05:35 -070051 virtualbox__intnet: settings['vm_management_network_name'],
Zack Williams0a7ef162017-07-18 18:15:26 -070052 libvirt__network_name: settings['vm_management_network_name'],
Zack Williamsa1f55082017-02-28 22:41:36 -070053 libvirt__forward_mode: "none",
54 libvirt__dhcp_enabled: false
Zack Williams9f42b972018-01-10 15:05:35 -070055 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 Williamsa1f55082017-02-28 22:41:36 -070063 end
64
65 config.vm.define "compute2" do |c|
66 c.vm.hostname = "compute2"
67 c.vm.provider :libvirt do |v|
Zack Williamsce63eb02017-02-28 10:46:22 -070068 v.memory = settings['compute_vm_mem']
Zack Williams0a7ef162017-07-18 18:15:26 -070069 v.cpus = settings['compute_vm_cpu']
Zack Williamsa1f55082017-02-28 22:41:36 -070070 v.machine_virtual_size = 50
71 v.nested = true
Zack Williamsa1f55082017-02-28 22:41:36 -070072 end
73 c.vm.network "private_network", # management network, eth1
Zack Williams9f42b972018-01-10 15:05:35 -070074 adapter: 1,
75 ip: "0.1.0.0",
Zack Williamsa1f55082017-02-28 22:41:36 -070076 auto_config: false,
Zack Williams9f42b972018-01-10 15:05:35 -070077 virtualbox__intnet: settings['vm_management_network_name'],
Zack Williams0a7ef162017-07-18 18:15:26 -070078 libvirt__network_name: settings['vm_management_network_name'],
Zack Williamsa1f55082017-02-28 22:41:36 -070079 libvirt__forward_mode: "none",
80 libvirt__dhcp_enabled: false
Zack Williams9f42b972018-01-10 15:05:35 -070081 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 Williamsa1f55082017-02-28 22:41:36 -070089 end
90
91end
Zack Williamsce63eb02017-02-28 10:46:22 -070092