forked from SSSD/sssd-test-suite
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Vagrantfile
84 lines (77 loc) · 1.83 KB
/
Vagrantfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
require_relative './ruby/config.rb'
require_relative './ruby/machine.rb'
require_relative './ruby/guest.rb'
# Get configuration
project_dir = File.expand_path(File.dirname(__FILE__))
config_file = sprintf("%s/config.json", project_dir)
if ENV.has_key?("SSSD_TEST_SUITE_CONFIG")
config_file = ENV["SSSD_TEST_SUITE_CONFIG"]
end
config = Config.new(config_file)
machines = [
Machine.new(
name: "ipa",
type: Machine::LINUX,
hostname: "master.ipa.vm",
ip: "192.168.100.10",
config: config
),
Machine.new(
name: "ldap",
type: Machine::LINUX,
hostname: "master.ldap.vm",
ip: "192.168.100.20",
config: config
),
Machine.new(
name: "client",
type: Machine::LINUX,
hostname: "master.client.vm",
ip: "192.168.100.30",
config: config
),
Machine.new(
name: "ad",
type: Machine::WINDOWS,
hostname: "root-dc",
ip: "192.168.100.110",
config: config
),
Machine.new(
name: "ad-child",
type: Machine::WINDOWS,
hostname: "child-dc",
ip: "192.168.100.120",
config: config
)
]
# Print information about environment
if ARGV[0] == "status"
puts ""
puts "Current configuration:"
puts ""
printf(" %-10s (%-15s, %-20s, %-7s) - %s\n",
"NAME", "IP ADDRESS", "HOSTNAME", "MEMORY", "BOX NAME")
machines.each do |m|
hostname = m.hostname
case hostname
when "root-dc"
hostname = "#{m.hostname}.ad.vm"
when "child-dc"
hostname = "#{m.hostname}.child.ad.vm"
end
box = m.box
if box.nil? or box.empty?
box = "(disabled)"
end
printf(" %-10s (%-15s, %-20s, %-4d MB) - %s\n",
m.name, m.ip, hostname, m.memory, box)
end
puts ""
end
# Create SSSD environment
Vagrant.configure("2") do |vagrant_config|
machines.each do |machine|
Guest.Add(config, vagrant_config, machine)
end
end