This repository has been archived by the owner on Sep 13, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
/
types.rb
180 lines (147 loc) · 6.3 KB
/
types.rb
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
# Options you can set and their defaults...
# :installer => :core,
# :install_version => nil,
# :setup => [],
# :dctest => [],
# :box => 'ubuntu-13.04',
# :count => 1,
# :ip => "10.1.1.12",
# :bootstrap_ip => nil,
# :dcurl => 'https://github.com/cfengine/design-center.git',
# :dcbranch => 'master',
# :vmname => 'cftester',
# :vmsize => "1024",
# :baseport => "8080",
# :fport => "80",
module Types
FRAGMENTS = {
:inone => { :installer => :none },
:ipackages => { :installer => :packages },
:icore => { :installer => :core },
:ubuntu_on_ec2 => { :provider => :ec2, :ec2_options => { :ami => "ami-a29943cb", :instance_type => "t1.micro", :region => "us-east-1", :security_group => "default" } },
:ubuntu_10_04 => { :box => "ubuntu-10.04-amd64", :vmname => "BOX-64-" },
:ubuntu_10_04_i386 => { :box => "ubuntu-10.04-i386", :vmname => "BOX-32-" },
:ubuntu_10_10 => { :box => "ubuntu-10.10-amd64", :vmname => "BOX-64-" },
:ubuntu_11_04 => { :box => "ubuntu-11.04-amd64", :vmname => "BOX-64-" },
:ubuntu_11_10 => { :box => "ubuntu-11.10-amd64", :vmname => "BOX-64-" },
:ubuntu_12_04 => { :box => "ubuntu-12.04-amd64", :vmname => "BOX-64-" },
:ubuntu_12_10 => { :box => "ubuntu-12.10-amd64", :vmname => "BOX-64-" },
:ubuntu_13_04 => { :box => "ubuntu-13.04-amd64", :vmname => "BOX-64-" },
:ubuntu_precise => { :box => "precise32", :vmname => "BOX-32-" },
:ubuntu_lucid => { :box => "lucid32", :vmname => "BOX-32-" },
:suse_11_4 => { :box => "SUSE", :vmname => "BOX-64-" },
:centos_5_5 => { :box => "centos-5.5", :vmname => "BOX-64-" },
:centos_5_6 => { :box => "centos-5.6", :vmname => "BOX-64-" },
:centos_5_7 => { :box => "centos-5.7", :vmname => "BOX-64-" },
:centos_5_8 => { :box => "centos-5.8", :vmname => "BOX-64-" },
:centos_5_9 => { :box => "centos-5.9", :vmname => "BOX-64-" },
:centos_6_0 => { :box => "centos-6.0", :vmname => "BOX-64-" },
:centos_6_1 => { :box => "centos-6.1", :vmname => "BOX-64-" },
:centos_6_2 => { :box => "centos-6.2", :vmname => "BOX-64-" },
:centos_6_3 => { :box => "centos-6.3", :vmname => "BOX-64-" },
:centos_6_4 => { :box => "centos-6.4", :vmname => "BOX-64-" },
:core_checkout_351 => { :install_version => "3.5.1" },
:core_checkout_352 => { :install_version => "3.5.2" },
:core_checkout_master => { :install_version => "master" },
:centos_client_enterprise352_rpm => { :install_version => "/vagrant/resources/packages/cfengine-nova-3.5.2-1.x86_64.rpm" },
:ubuntu_client_enterprise352_deb => { :install_version => "/vagrant/resources/packages/cfengine-nova_3.5.2-1_amd64.deb" },
:centos_hub_enterprise352_rpm => { :install_version => "/vagrant/resources/packages/cfengine-nova-hub-3.5.2-1.x86_64.rpm" },
:ubuntu_hub_enterprise352_deb => { :install_version => "/vagrant/resources/packages/cfengine-nova-hub_3.5.2-1_amd64.deb" },
}
TEMPLATES = {
:hub => { :setup => [ "bootstrap", "custom_masterfiles", "dc", "hub", "converge" ] },
:generic => { :setup => [ "converge" ] },
:jenkins => { :setup => [ "jenkins" ], :fport => 8080 },
}
TYPES = {
"single_centos_hub" => {}
.merge(FRAGMENTS[:ipackages])
.merge(FRAGMENTS[:centos_6_4])
.merge(FRAGMENTS[:centos_hub_enterprise352_rpm])
.merge(TEMPLATES[:hub])
.merge({ :ip => "10.0.0.20", :count => 1 }),
"single_ubuntu_hub" => {}
.merge(FRAGMENTS[:ipackages])
.merge(FRAGMENTS[:ubuntu_13_04])
.merge(FRAGMENTS[:ubuntu_hub_enterprise352_deb])
.merge(TEMPLATES[:hub])
.merge({ :ip => "10.0.0.20", :count => 1 }),
"single_centos_eclient" => {}
.merge(FRAGMENTS[:ipackages])
.merge(FRAGMENTS[:centos_6_4])
.merge(FRAGMENTS[:centos_client_enterprise352_rpm])
.merge(TEMPLATES[:generic])
.merge({ :ip => "10.0.0.20", :count => 1 }),
"single_ubuntu_eclient" => {}
.merge(FRAGMENTS[:ipackages])
.merge(FRAGMENTS[:ubuntu_13_04])
.merge(FRAGMENTS[:ubuntu_client_enterprise352_deb])
.merge(TEMPLATES[:generic])
.merge({ :ip => "10.0.0.20", :count => 1 }),
"single_centos_cclient" => {}
.merge(FRAGMENTS[:ipackages])
.merge(FRAGMENTS[:centos_6_4])
.merge(TEMPLATES[:generic])
.merge({ :ip => "10.0.0.20", :count => 1 }),
"single_ubuntu_cclient" => {}
.merge(FRAGMENTS[:ipackages])
.merge(FRAGMENTS[:ubuntu_13_04])
.merge(TEMPLATES[:generic])
.merge({ :ip => "10.0.0.20", :count => 1 }),
"single_suse_cclient" => {}
.merge(FRAGMENTS[:ipackages])
.merge(FRAGMENTS[:suse_11_4])
.merge(TEMPLATES[:generic])
.merge({ :ip => "10.0.0.20", :count => 1 }),
"single_centos_source" => {}
.merge(FRAGMENTS[:icore])
.merge(FRAGMENTS[:centos_6_4])
.merge(FRAGMENTS[:core_checkout_master])
.merge(TEMPLATES[:generic])
.merge({ :ip => "10.0.0.20", :count => 1 }),
"single_ubuntu_source" => {}
.merge(FRAGMENTS[:icore])
.merge(FRAGMENTS[:ubuntu_13_04])
.merge(FRAGMENTS[:core_checkout_master])
.merge(TEMPLATES[:generic])
.merge({ :ip => "10.0.0.20", :count => 1 }),
"single_suse_source" => {}
.merge(FRAGMENTS[:icore])
.merge(FRAGMENTS[:suse_11_4])
.merge(FRAGMENTS[:core_checkout_master])
.merge(TEMPLATES[:generic])
.merge({ :ip => "10.0.0.20", :count => 1 }),
"single_centos" => {}
.merge(FRAGMENTS[:inone])
.merge(FRAGMENTS[:centos_6_4])
.merge({ :ip => "10.0.0.20", :count => 1 }),
"single_centos_jenkins" => {}
.merge(FRAGMENTS[:inone])
.merge(FRAGMENTS[:centos_6_4])
.merge(TEMPLATES[:jenkins])
.merge({ :ip => "10.0.0.20", :count => 1 }),
"single_ubuntu" => {}
.merge(FRAGMENTS[:inone])
.merge(FRAGMENTS[:ubuntu_13_04])
.merge({ :ip => "10.0.0.20", :count => 1 }),
"single_suse" => {}
.merge(FRAGMENTS[:inone])
.merge(FRAGMENTS[:suse_11_4])
.merge({ :ip => "10.0.0.20", :count => 1 }),
"single_ubuntu_ec2" => {}
.merge(FRAGMENTS[:inone])
.merge(FRAGMENTS[:ubuntu_on_ec2])
.merge({ :count => 1 }),
}
def Types.type(name)
unless TYPES.has_key?(name)
abort "Sorry, we can't find the requested type #{name}"
end
# puts "Got type:"
# pp TYPES[name]
return TYPES[name]
end
def Types.types()
return TYPES
end
end