tacker/vagrant/devstack/lib/machine.rb
Yasufumi Ogawa fc73097874 Update config in tacker installer
For a limitation of IP address range of hostonly network which was
added in the recent update in VirtualBox [1], allowed only
192.168.56.0/21, the installer is terminated without you give
appropriate IP addresses to your VMs.

Forwarding port `10080` for HTTP is also invalid in security for some
browsers. `20080` is valid for the restriction.

This update is to update default values of IP address and port to be
allowed.

[1] https://www.virtualbox.org/manual/ch06.html#network_hostonly

Closes-Bug: #1980312
Signed-off-by: Yasufumi Ogawa <yasufum.o@gmail.com>
Change-Id: I7fbce874ce2445ea72e627e0ad6309062fac9292
2022-07-07 01:19:48 +00:00

39 lines
1.1 KiB
Ruby

require "yaml"
class Machines < Array
class Machine
attr_reader :hostname, :provider, :box, :nof_cpus, :mem_size, :disk_size,
:private_ips, :public_ips, :ssh_forward_x11, :fwd_port_list
def initialize(
hostname="controller", provider="virtualbox", box="ubuntu/focal64",
nof_cpus=2, mem_size=4, disk_size=10,
private_ips=["192.168.56.11"], public_ips=nil, ssh_forward_x11=false,
fwd_port_list=nil)
@hostname = hostname
@provider = provider
@box = box
@nof_cpus = nof_cpus
@mem_size = mem_size
@disk_size = disk_size
@private_ips = private_ips
@public_ips = public_ips
@ssh_forward_x11 = ssh_forward_x11
@fwd_port_list = fwd_port_list
end
end
def initialize(machines_attr)
machines_attr.each_with_index do |m, idx|
self[idx] = Machine.new(
m["hostname"], m["provider"], m["box"],
m["nof_cpus"], m["mem_size"], m["disk_size"],
m["private_ips"], m["public_ips"],
m["ssh_forward_x11"],
m["fwd_port_list"])
end
end
end