beaker-hostgenerator 0.5.0 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (185) hide show
  1. checksums.yaml +8 -8
  2. data/CHANGELOG.md +4 -0
  3. data/HISTORY.md +233 -2
  4. data/README.md +50 -11
  5. data/beaker-hostgenerator.gemspec +2 -2
  6. data/lib/beaker-hostgenerator.rb +0 -1
  7. data/lib/beaker-hostgenerator/cli.rb +38 -26
  8. data/lib/beaker-hostgenerator/data.rb +960 -35
  9. data/lib/beaker-hostgenerator/generator.rb +57 -97
  10. data/lib/beaker-hostgenerator/hypervisor.rb +97 -0
  11. data/lib/beaker-hostgenerator/hypervisor/none.rb +17 -0
  12. data/lib/beaker-hostgenerator/hypervisor/vmpooler.rb +32 -0
  13. data/lib/beaker-hostgenerator/parser.rb +199 -0
  14. data/lib/beaker-hostgenerator/roles.rb +21 -14
  15. data/lib/beaker-hostgenerator/util.rb +10 -29
  16. data/lib/beaker-hostgenerator/version.rb +1 -1
  17. data/spec/beaker-hostgenerator/generator_spec.rb +73 -109
  18. data/spec/beaker-hostgenerator/parser_spec.rb +84 -0
  19. data/test/fixtures/default/cisconx-64a +1 -1
  20. data/test/fixtures/default/windows10ent-32d +22 -0
  21. data/test/fixtures/default/windows10ent-64f +22 -0
  22. data/test/fixtures/default/windows10pro-64m +22 -0
  23. data/test/fixtures/default/windows2003-6432d +22 -0
  24. data/test/fixtures/default/windows2003-64c +22 -0
  25. data/test/fixtures/default/windows2003r2-32f +22 -0
  26. data/test/fixtures/default/windows2003r2-6432aulcdfm +27 -0
  27. data/test/fixtures/default/windows2003r2-64m +22 -0
  28. data/test/fixtures/default/windows2008-6432u +22 -0
  29. data/test/fixtures/default/windows2008-64a +21 -0
  30. data/test/fixtures/default/windows2008r2-6432c +22 -0
  31. data/test/fixtures/default/windows2008r2-64l +22 -0
  32. data/test/fixtures/default/windows2012-6432f +22 -0
  33. data/test/fixtures/default/windows2012-64d +22 -0
  34. data/test/fixtures/default/windows2012r2-6432aulcdfm +27 -0
  35. data/test/fixtures/default/windows2012r2-64m +22 -0
  36. data/test/fixtures/default/windows7-64a +21 -0
  37. data/test/fixtures/default/windows8-64u +22 -0
  38. data/test/fixtures/default/windows81-64l +22 -0
  39. data/test/fixtures/default/windowsvista-64c +22 -0
  40. data/test/fixtures/multiplatform/arista4-32a-windows10pro-64-arista4-32aulcdfm +47 -0
  41. data/test/fixtures/multiplatform/centos4-32u-windows10ent-64-centos4-32m +43 -0
  42. data/test/fixtures/multiplatform/centos4-64l-windows10ent-32-centos4-64f +43 -0
  43. data/test/fixtures/multiplatform/centos5-32c-windowsvista-64-centos5-32d +43 -0
  44. data/test/fixtures/multiplatform/centos5-64d-windows81-64-centos5-64c +43 -0
  45. data/test/fixtures/multiplatform/centos6-32f-windows8-64-centos6-32l +43 -0
  46. data/test/fixtures/multiplatform/centos6-64m-windows7-64-centos6-64u +43 -0
  47. data/test/fixtures/multiplatform/centos7-64aulcdfm-windows2012r2-6432-centos7-64a +47 -0
  48. data/test/fixtures/multiplatform/cisconx-64a-windows2012r2-64-cisconx-64aulcdfm +53 -0
  49. data/test/fixtures/multiplatform/ciscoxr-64u-windows2012-6432-ciscoxr-64m +43 -0
  50. data/test/fixtures/multiplatform/cumulus25-64l-windows2012-64-cumulus25-64f +43 -0
  51. data/test/fixtures/multiplatform/debian6-32c-windows2008r2-6432-debian6-32d +43 -0
  52. data/test/fixtures/multiplatform/debian6-64d-windows2008r2-64-debian6-64c +43 -0
  53. data/test/fixtures/multiplatform/debian7-32f-windows2008-6432-debian7-32l +43 -0
  54. data/test/fixtures/multiplatform/debian7-64m-windows2008-64-debian7-64u +43 -0
  55. data/test/fixtures/multiplatform/debian8-32aulcdfm-windows2003r2-6432-debian8-32a +47 -0
  56. data/test/fixtures/multiplatform/debian8-64a-windows2003r2-64-debian8-64aulcdfm +47 -0
  57. data/test/fixtures/multiplatform/debian9-32u-windows2003r2-32-debian9-32m +43 -0
  58. data/test/fixtures/multiplatform/debian9-64l-windows2003-6432-debian9-64f +43 -0
  59. data/test/fixtures/multiplatform/fedora14-32l-solaris11-64-fedora14-32f +42 -0
  60. data/test/fixtures/multiplatform/fedora19-32c-solaris11-32-fedora19-32d +42 -0
  61. data/test/fixtures/multiplatform/fedora19-64d-solaris10-64-fedora19-64c +42 -0
  62. data/test/fixtures/multiplatform/fedora20-32f-solaris10-32-fedora20-32l +42 -0
  63. data/test/fixtures/multiplatform/fedora20-64m-sles12-64-fedora20-64u +42 -0
  64. data/test/fixtures/multiplatform/fedora21-32aulcdfm-sles11-64-fedora21-32a +46 -0
  65. data/test/fixtures/multiplatform/fedora21-64a-sles11-32-fedora21-64aulcdfm +46 -0
  66. data/test/fixtures/multiplatform/fedora22-32u-sles10-64-fedora22-32m +42 -0
  67. data/test/fixtures/multiplatform/fedora22-64l-sles10-32-fedora22-64f +42 -0
  68. data/test/fixtures/multiplatform/fedora23-32c-scientific7-64-fedora23-32d +42 -0
  69. data/test/fixtures/multiplatform/fedora23-64d-scientific6-64-fedora23-64c +42 -0
  70. data/test/fixtures/multiplatform/opensuse11-32f-scientific6-32-opensuse11-32l +42 -0
  71. data/test/fixtures/multiplatform/opensuse11-64m-scientific5-64-opensuse11-64u +42 -0
  72. data/test/fixtures/multiplatform/oracle5-32c-windows2003-64-oracle5-32d +43 -0
  73. data/test/fixtures/multiplatform/oracle5-64d-ubuntu1604-64-oracle5-64c +42 -0
  74. data/test/fixtures/multiplatform/oracle6-32f-ubuntu1604-32-oracle6-32l +42 -0
  75. data/test/fixtures/multiplatform/oracle6-64m-ubuntu1510-64-oracle6-64u +42 -0
  76. data/test/fixtures/multiplatform/oracle7-64aulcdfm-ubuntu1510-32-oracle7-64a +46 -0
  77. data/test/fixtures/multiplatform/osx1010-64u-ubuntu1504-32-osx1010-64m +42 -0
  78. data/test/fixtures/multiplatform/osx1011-64l-ubuntu1404-64-osx1011-64f +42 -0
  79. data/test/fixtures/multiplatform/osx109-64a-ubuntu1504-64-osx109-64aulcdfm +46 -0
  80. data/test/fixtures/multiplatform/redhat4-32c-ubuntu1404-32-redhat4-32d +42 -0
  81. data/test/fixtures/multiplatform/redhat4-64d-ubuntu1204-64-redhat4-64c +42 -0
  82. data/test/fixtures/multiplatform/redhat5-32f-ubuntu1204-32-redhat5-32l +42 -0
  83. data/test/fixtures/multiplatform/redhat5-64m-ubuntu1004-64-redhat5-64u +42 -0
  84. data/test/fixtures/multiplatform/redhat6-32aulcdfm-ubuntu1004-32-redhat6-32a +46 -0
  85. data/test/fixtures/multiplatform/redhat6-64a-solaris112-64-redhat6-64aulcdfm +46 -0
  86. data/test/fixtures/multiplatform/redhat7-64u-solaris112-32-redhat7-64m +42 -0
  87. data/test/fixtures/multiplatform/scientific5-32aulcdfm-scientific5-32-scientific5-32a +46 -0
  88. data/test/fixtures/multiplatform/scientific5-64a-opensuse11-64-scientific5-64aulcdfm +46 -0
  89. data/test/fixtures/multiplatform/scientific6-32u-opensuse11-32-scientific6-32m +42 -0
  90. data/test/fixtures/multiplatform/scientific6-64l-fedora23-64-scientific6-64f +42 -0
  91. data/test/fixtures/multiplatform/scientific7-64c-fedora23-32-scientific7-64d +42 -0
  92. data/test/fixtures/multiplatform/sles10-32d-fedora22-64-sles10-32c +42 -0
  93. data/test/fixtures/multiplatform/sles10-64f-fedora22-32-sles10-64l +42 -0
  94. data/test/fixtures/multiplatform/sles11-32m-fedora21-64-sles11-32u +42 -0
  95. data/test/fixtures/multiplatform/sles11-64aulcdfm-fedora21-32-sles11-64a +46 -0
  96. data/test/fixtures/multiplatform/sles12-64a-fedora20-64-sles12-64aulcdfm +46 -0
  97. data/test/fixtures/multiplatform/solaris10-32u-fedora20-32-solaris10-32m +42 -0
  98. data/test/fixtures/multiplatform/solaris10-64l-fedora19-64-solaris10-64f +42 -0
  99. data/test/fixtures/multiplatform/solaris11-32c-fedora19-32-solaris11-32d +42 -0
  100. data/test/fixtures/multiplatform/solaris11-64d-fedora14-32-solaris11-64c +42 -0
  101. data/test/fixtures/multiplatform/solaris112-32f-redhat7-64-solaris112-32l +42 -0
  102. data/test/fixtures/multiplatform/solaris112-64m-redhat6-64-solaris112-64u +42 -0
  103. data/test/fixtures/multiplatform/ubuntu1004-32aulcdfm-redhat6-32-ubuntu1004-32a +46 -0
  104. data/test/fixtures/multiplatform/ubuntu1004-64a-redhat5-64-ubuntu1004-64aulcdfm +46 -0
  105. data/test/fixtures/multiplatform/ubuntu1204-32u-redhat5-32-ubuntu1204-32m +42 -0
  106. data/test/fixtures/multiplatform/ubuntu1204-64l-redhat4-64-ubuntu1204-64f +42 -0
  107. data/test/fixtures/multiplatform/ubuntu1404-32c-redhat4-32-ubuntu1404-32d +42 -0
  108. data/test/fixtures/multiplatform/ubuntu1404-64d-osx1011-64-ubuntu1404-64c +42 -0
  109. data/test/fixtures/multiplatform/ubuntu1504-32f-osx1010-64-ubuntu1504-32l +42 -0
  110. data/test/fixtures/multiplatform/ubuntu1504-64m-osx109-64-ubuntu1504-64u +42 -0
  111. data/test/fixtures/multiplatform/ubuntu1510-32aulcdfm-oracle7-64-ubuntu1510-32a +46 -0
  112. data/test/fixtures/multiplatform/ubuntu1510-64a-oracle6-64-ubuntu1510-64aulcdfm +46 -0
  113. data/test/fixtures/multiplatform/ubuntu1604-32u-oracle6-32-ubuntu1604-32m +42 -0
  114. data/test/fixtures/multiplatform/ubuntu1604-64l-oracle5-64-ubuntu1604-64f +42 -0
  115. data/test/fixtures/multiplatform/windows10ent-32d-centos4-64-windows10ent-32c +44 -0
  116. data/test/fixtures/multiplatform/windows10ent-64f-centos4-32-windows10ent-64l +44 -0
  117. data/test/fixtures/multiplatform/windows10pro-64m-arista4-32-windows10pro-64u +44 -0
  118. data/test/fixtures/multiplatform/windows2003-6432d-debian9-64-windows2003-6432c +44 -0
  119. data/test/fixtures/multiplatform/windows2003-64c-oracle5-32-windows2003-64d +44 -0
  120. data/test/fixtures/multiplatform/windows2003r2-32f-debian9-32-windows2003r2-32l +44 -0
  121. data/test/fixtures/multiplatform/windows2003r2-6432aulcdfm-debian8-32-windows2003r2-6432a +48 -0
  122. data/test/fixtures/multiplatform/windows2003r2-64m-debian8-64-windows2003r2-64u +44 -0
  123. data/test/fixtures/multiplatform/windows2008-6432u-debian7-32-windows2008-6432m +44 -0
  124. data/test/fixtures/multiplatform/windows2008-64a-debian7-64-windows2008-64aulcdfm +48 -0
  125. data/test/fixtures/multiplatform/windows2008r2-6432c-debian6-32-windows2008r2-6432d +44 -0
  126. data/test/fixtures/multiplatform/windows2008r2-64l-debian6-64-windows2008r2-64f +44 -0
  127. data/test/fixtures/multiplatform/windows2012-6432f-ciscoxr-64-windows2012-6432l +44 -0
  128. data/test/fixtures/multiplatform/windows2012-64d-cumulus25-64-windows2012-64c +44 -0
  129. data/test/fixtures/multiplatform/windows2012r2-6432aulcdfm-centos7-64-windows2012r2-6432a +48 -0
  130. data/test/fixtures/multiplatform/windows2012r2-64m-cisconx-64-windows2012r2-64u +47 -0
  131. data/test/fixtures/multiplatform/windows7-64a-centos6-64-windows7-64aulcdfm +48 -0
  132. data/test/fixtures/multiplatform/windows8-64u-centos6-32-windows8-64m +44 -0
  133. data/test/fixtures/multiplatform/windows81-64l-centos5-64-windows81-64f +44 -0
  134. data/test/fixtures/multiplatform/windowsvista-64c-centos5-32-windowsvista-64d +44 -0
  135. data/test/fixtures/osinfo-version-0/cisconx-64a +1 -1
  136. data/test/fixtures/osinfo-version-0/windows10ent-32d +22 -0
  137. data/test/fixtures/osinfo-version-0/windows10ent-64f +22 -0
  138. data/test/fixtures/osinfo-version-0/windows10pro-64m +22 -0
  139. data/test/fixtures/osinfo-version-0/windows2003-6432d +22 -0
  140. data/test/fixtures/osinfo-version-0/windows2003-64c +22 -0
  141. data/test/fixtures/osinfo-version-0/windows2003r2-32f +22 -0
  142. data/test/fixtures/osinfo-version-0/windows2003r2-6432aulcdfm +27 -0
  143. data/test/fixtures/osinfo-version-0/windows2003r2-64m +22 -0
  144. data/test/fixtures/osinfo-version-0/windows2008-6432u +22 -0
  145. data/test/fixtures/osinfo-version-0/windows2008-64a +21 -0
  146. data/test/fixtures/osinfo-version-0/windows2008r2-6432c +22 -0
  147. data/test/fixtures/osinfo-version-0/windows2008r2-64l +22 -0
  148. data/test/fixtures/osinfo-version-0/windows2012-6432f +22 -0
  149. data/test/fixtures/osinfo-version-0/windows2012-64d +22 -0
  150. data/test/fixtures/osinfo-version-0/windows2012r2-6432aulcdfm +27 -0
  151. data/test/fixtures/osinfo-version-0/windows2012r2-64m +22 -0
  152. data/test/fixtures/osinfo-version-0/windows7-64a +21 -0
  153. data/test/fixtures/osinfo-version-0/windows8-64u +22 -0
  154. data/test/fixtures/osinfo-version-0/windows81-64l +22 -0
  155. data/test/fixtures/osinfo-version-0/windowsvista-64c +22 -0
  156. data/test/fixtures/osinfo-version-1/cisconx-64a +1 -1
  157. data/test/fixtures/osinfo-version-1/windows10ent-32d +22 -0
  158. data/test/fixtures/osinfo-version-1/windows10ent-64f +22 -0
  159. data/test/fixtures/osinfo-version-1/windows10pro-64m +22 -0
  160. data/test/fixtures/osinfo-version-1/windows2003-6432d +22 -0
  161. data/test/fixtures/osinfo-version-1/windows2003-64c +22 -0
  162. data/test/fixtures/osinfo-version-1/windows2003r2-32f +22 -0
  163. data/test/fixtures/osinfo-version-1/windows2003r2-6432aulcdfm +27 -0
  164. data/test/fixtures/osinfo-version-1/windows2003r2-64m +22 -0
  165. data/test/fixtures/osinfo-version-1/windows2008-6432u +22 -0
  166. data/test/fixtures/osinfo-version-1/windows2008-64a +21 -0
  167. data/test/fixtures/osinfo-version-1/windows2008r2-6432c +22 -0
  168. data/test/fixtures/osinfo-version-1/windows2008r2-64l +22 -0
  169. data/test/fixtures/osinfo-version-1/windows2012-6432f +22 -0
  170. data/test/fixtures/osinfo-version-1/windows2012-64d +22 -0
  171. data/test/fixtures/osinfo-version-1/windows2012r2-6432aulcdfm +27 -0
  172. data/test/fixtures/osinfo-version-1/windows2012r2-64m +22 -0
  173. data/test/fixtures/osinfo-version-1/windows7-64a +21 -0
  174. data/test/fixtures/osinfo-version-1/windows8-64u +22 -0
  175. data/test/fixtures/osinfo-version-1/windows81-64l +22 -0
  176. data/test/fixtures/osinfo-version-1/windowsvista-64c +22 -0
  177. data/test/fixtures/per-host-settings/arbitrary-settings.yaml +57 -0
  178. data/test/fixtures/per-host-settings/every-hypervisor.yaml +30 -0
  179. data/test/fixtures/per-host-settings/malformed-input.yaml +5 -0
  180. data/test/test_stdout.rb +2 -2
  181. data/test/util/generator_helpers.rb +12 -4
  182. metadata +167 -6
  183. data/lib/beaker-hostgenerator/data/vmpooler.rb +0 -467
  184. data/lib/beaker-hostgenerator/generator/vmpooler.rb +0 -59
  185. data/test/test_util.rb +0 -26
@@ -1,5 +1,18 @@
1
1
  module BeakerHostGenerator
2
+ # Contains all the platform information that ends up in the generated hosts
3
+ # configuration. This includes the various OS-specific platform
4
+ # configuration, and PE-specific installation & upgrade configuration.
5
+ #
6
+ # Any data used by any hypervisor or any other abstraction should be defined
7
+ # in this module, likely in the `osinfo` hash. The hypervisor implementation
8
+ # must then use the provided module functions (likely `get_platform_info`) to
9
+ # extract the relevant portions of the `osinfo` data.
10
+ #
11
+ # This module is intended to be used by either directly accessing the static
12
+ # functions like `BeakerHostGenerator::Data.<function>()` or as a mixin via
13
+ # `include BeakerHostGenerator::Data` and then `<function>()`.
2
14
  module Data
15
+ module_function
3
16
 
4
17
  def pe_version
5
18
  ENV['pe_version']
@@ -17,42 +30,20 @@ module BeakerHostGenerator
17
30
  ENV['pe_upgrade_family']
18
31
  end
19
32
 
20
- PE_USE_WIN32=ENV['pe_use_win32']
33
+ def pe_dir(version, family)
34
+ # If our version is the same as our family, we're installing a
35
+ # released version. Use the archive path. Otherwise, we want to use
36
+ # the development build path.
37
+ if version && family
38
+ if version == family
39
+ "http://enterprise.delivery.puppetlabs.net/archives/releases/#{family}/"
40
+ else
41
+ "http://enterprise.delivery.puppetlabs.net/#{family}/ci-ready"
42
+ end
43
+ end
44
+ end
21
45
 
22
- ROLES = {
23
- 'a' => 'agent',
24
- 'u' => 'ca',
25
- 'l' => 'classifier',
26
- 'c' => 'dashboard',
27
- 'd' => 'database',
28
- 'f' => 'frictionless',
29
- 'm' => 'master',
30
- }
31
-
32
- # Capture role and bit width information about the node.
33
- #
34
- # Examples node specs and their resulting roles
35
- #
36
- # 64compile_master,zuul,meow.a
37
- # * compile_master
38
- # * zuul
39
- # * meow
40
- # * agent
41
- #
42
- # 32herp.cdma
43
- # * herp
44
- # * dashboard
45
- # * database
46
- # * master
47
- # * agent
48
- #
49
- # 64dashboard,master,agent,database.
50
- # * dashboard
51
- # * master
52
- # * agent
53
- # * database
54
- #
55
- NODE_REGEX=/\A(?<bits>\d+)((?<arbitrary_roles>([[:lower:]_]*|\,)*)\.)?(?<roles>[uacldfm]*)\Z/
46
+ PE_USE_WIN32 = ENV['pe_use_win32']
56
47
 
57
48
  BASE_CONFIG = {
58
49
  'HOSTS' => {},
@@ -61,5 +52,939 @@ module BeakerHostGenerator
61
52
  'consoleport' => 443,
62
53
  }
63
54
  }
55
+
56
+ def base_host_config(options)
57
+ {
58
+ 'pe_dir' => options[:pe_dir] || pe_dir(pe_version, pe_family),
59
+ 'pe_ver' => options[:pe_ver] || pe_version,
60
+ 'pe_upgrade_dir' => options[:pe_upgrade_dir] || pe_dir(pe_upgrade_version, pe_upgrade_family),
61
+ 'pe_upgrade_ver' => options[:pe_upgrade_ver] || pe_upgrade_version,
62
+ }
63
+ end
64
+
65
+ def osinfo
66
+ {
67
+ 'arista4-32' => {
68
+ :general => {
69
+ 'platform' => 'eos-4-i386'
70
+ },
71
+ :vmpooler => {
72
+ 'template' => 'arista-4-i386'
73
+ }
74
+ },
75
+ 'centos4-32' => {
76
+ :general => {
77
+ 'platform' => 'el-4-i386'
78
+ },
79
+ :vmpooler => {
80
+ 'template' => 'centos-4-i386'
81
+ }
82
+ },
83
+ 'centos4-64' => {
84
+ :general => {
85
+ 'platform' => 'el-4-x86_64'
86
+ },
87
+ :vmpooler => {
88
+ 'template' => 'centos-4-x86_64'
89
+ }
90
+ },
91
+ 'centos5-32' => {
92
+ :general => {
93
+ 'platform' => 'el-5-i386'
94
+ },
95
+ :vmpooler => {
96
+ 'template' => 'centos-5-i386'
97
+ }
98
+ },
99
+ 'centos5-64' => {
100
+ :general => {
101
+ 'platform' => 'el-5-x86_64'
102
+ },
103
+ :vmpooler => {
104
+ 'template' => 'centos-5-x86_64'
105
+ }
106
+ },
107
+ 'centos6-32' => {
108
+ :general => {
109
+ 'platform' => 'el-6-i386'
110
+ },
111
+ :vmpooler => {
112
+ 'template' => 'centos-6-i386'
113
+ }
114
+ },
115
+ 'centos6-64' => {
116
+ :general => {
117
+ 'platform' => 'el-6-x86_64'
118
+ },
119
+ :vmpooler => {
120
+ 'template' => 'centos-6-x86_64'
121
+ }
122
+ },
123
+ 'centos7-64' => {
124
+ :general => {
125
+ 'platform' => 'el-7-x86_64'
126
+ },
127
+ :vmpooler => {
128
+ 'template' => 'centos-7-x86_64'
129
+ }
130
+ },
131
+ 'cisconx-64' => {
132
+ :general => {
133
+ 'platform' => 'cisco_nexus-7-x86_64',
134
+ 'vrf' => 'management',
135
+ 'ssh' => {
136
+ 'user' => 'beaker'
137
+ }
138
+ },
139
+ :vmpooler => {
140
+ 'template' => 'cisco-nxos-9k-x86_64'
141
+ }
142
+ },
143
+ 'ciscoxr-64' => {
144
+ :general => {
145
+ 'platform' => 'cisco_ios_xr-6-x86_64'
146
+ },
147
+ :vmpooler => {
148
+ 'template' => 'cisco-exr-9k-x86_64'
149
+ }
150
+ },
151
+ 'cumulus25-64' => {
152
+ :general => {
153
+ 'platform' => 'cumulus-2.5-x86_64'
154
+ },
155
+ :vmpooler => {
156
+ 'template' => 'cumulus-vx-25-x86_64'
157
+ }
158
+ },
159
+ 'debian6-32' => {
160
+ :general => {
161
+ 'platform' => 'debian-6-i386'
162
+ },
163
+ :vmpooler => {
164
+ 'template' => 'debian-6-i386'
165
+ }
166
+ },
167
+ 'debian6-64' => {
168
+ :general => {
169
+ 'platform' => 'debian-6-amd64'
170
+ },
171
+ :vmpooler => {
172
+ 'template' => 'debian-6-x86_64'
173
+ }
174
+ },
175
+ 'debian7-32' => {
176
+ :general => {
177
+ 'platform' => 'debian-7-i386'
178
+ },
179
+ :vmpooler => {
180
+ 'template' => 'debian-7-i386'
181
+ }
182
+ },
183
+ 'debian7-64' => {
184
+ :general => {
185
+ 'platform' => 'debian-7-amd64'
186
+ },
187
+ :vmpooler => {
188
+ 'template' => 'debian-7-x86_64'
189
+ }
190
+ },
191
+ 'debian8-32' => {
192
+ :general => {
193
+ 'platform' => 'debian-8-i386'
194
+ },
195
+ :vmpooler => {
196
+ 'template' => 'debian-8-i386'
197
+ }
198
+ },
199
+ 'debian8-64' => {
200
+ :general => {
201
+ 'platform' => 'debian-8-amd64'
202
+ },
203
+ :vmpooler => {
204
+ 'template' => 'debian-8-x86_64'
205
+ }
206
+ },
207
+ 'debian9-32' => {
208
+ :general => {
209
+ 'platform' => 'debian-9-i386'
210
+ },
211
+ :vmpooler => {
212
+ 'template' => 'debian-9-i386'
213
+ }
214
+ },
215
+ 'debian9-64' => {
216
+ :general => {
217
+ 'platform' => 'debian-9-amd64'
218
+ },
219
+ :vmpooler => {
220
+ 'template' => 'debian-9-x86_64'
221
+ }
222
+ },
223
+ 'oracle5-32' => {
224
+ :general => {
225
+ 'platform' => 'el-5-i386'
226
+ },
227
+ :vmpooler => {
228
+ 'template' => 'oracle-5-i386'
229
+ }
230
+ },
231
+ 'oracle5-64' => {
232
+ :general => {
233
+ 'platform' => 'el-5-x86_64'
234
+ },
235
+ :vmpooler => {
236
+ 'template' => 'oracle-5-x86_64'
237
+ }
238
+ },
239
+ 'oracle6-32' => {
240
+ :general => {
241
+ 'platform' => 'el-6-i386'
242
+ },
243
+ :vmpooler => {
244
+ 'template' => 'oracle-6-i386'
245
+ }
246
+ },
247
+ 'oracle6-64' => {
248
+ :general => {
249
+ 'platform' => 'el-6-x86_64'
250
+ },
251
+ :vmpooler => {
252
+ 'template' => 'oracle-6-x86_64'
253
+ }
254
+ },
255
+ 'oracle7-64' => {
256
+ :general => {
257
+ 'platform' => 'el-7-x86_64'
258
+ },
259
+ :vmpooler => {
260
+ 'template' => 'oracle-7-x86_64'
261
+ }
262
+ },
263
+ 'osx109-64' => {
264
+ :general => {
265
+ 'platform' => 'osx-10.9-x86_64'
266
+ },
267
+ :vmpooler => {
268
+ 'template' => 'osx-109-x86_64'
269
+ }
270
+ },
271
+ 'osx1010-64' => {
272
+ :general => {
273
+ 'platform' => 'osx-10.10-x86_64'
274
+ },
275
+ :vmpooler => {
276
+ 'template' => 'osx-1010-x86_64'
277
+ }
278
+ },
279
+ 'osx1011-64' => {
280
+ :general => {
281
+ 'platform' => 'osx-10.11-x86_64'
282
+ },
283
+ :vmpooler => {
284
+ 'template' => 'osx-1011-x86_64'
285
+ }
286
+ },
287
+ 'redhat4-32' => {
288
+ :general => {
289
+ 'platform' => 'el-4-i386'
290
+ },
291
+ :vmpooler => {
292
+ 'template' => 'redhat-4-i386'
293
+ }
294
+ },
295
+ 'redhat4-64' => {
296
+ :general => {
297
+ 'platform' => 'el-4-x86_64'
298
+ },
299
+ :vmpooler => {
300
+ 'template' => 'redhat-4-x86_64'
301
+ }
302
+ },
303
+ 'redhat5-32' => {
304
+ :general => {
305
+ 'platform' => 'el-5-i386'
306
+ },
307
+ :vmpooler => {
308
+ 'template' => 'redhat-5-i386'
309
+ }
310
+ },
311
+ 'redhat5-64' => {
312
+ :general => {
313
+ 'platform' => 'el-5-x86_64'
314
+ },
315
+ :vmpooler => {
316
+ 'template' => 'redhat-5-x86_64'
317
+ }
318
+ },
319
+ 'redhat6-32' => {
320
+ :general => {
321
+ 'platform' => 'el-6-i386'
322
+ },
323
+ :vmpooler => {
324
+ 'template' => 'redhat-6-i386'
325
+ }
326
+ },
327
+ 'redhat6-64' => {
328
+ :general => {
329
+ 'platform' => 'el-6-x86_64'
330
+ },
331
+ :vmpooler => {
332
+ 'template' => 'redhat-6-x86_64'
333
+ }
334
+ },
335
+ 'redhat7-64' => {
336
+ :general => {
337
+ 'platform' => 'el-7-x86_64'
338
+ },
339
+ :vmpooler => {
340
+ 'template' => 'redhat-7-x86_64'
341
+ }
342
+ },
343
+ 'fedora14-32' => {
344
+ :general => {
345
+ 'platform' => 'fedora-14-i386'
346
+ },
347
+ :vmpooler => {
348
+ 'template' => 'fedora-14-i386'
349
+ }
350
+ },
351
+ 'fedora19-32' => {
352
+ :general => {
353
+ 'platform' => 'fedora-19-i386'
354
+ },
355
+ :vmpooler => {
356
+ 'template' => 'fedora-19-i386'
357
+ }
358
+ },
359
+ 'fedora19-64' => {
360
+ :general => {
361
+ 'platform' => 'fedora-19-x86_64'
362
+ },
363
+ :vmpooler => {
364
+ 'template' => 'fedora-19-x86_64'
365
+ }
366
+ },
367
+ 'fedora20-32' => {
368
+ :general => {
369
+ 'platform' => 'fedora-20-i386'
370
+ },
371
+ :vmpooler => {
372
+ 'template' => 'fedora-20-i386'
373
+ }
374
+ },
375
+ 'fedora20-64' => {
376
+ :general => {
377
+ 'platform' => 'fedora-20-x86_64'
378
+ },
379
+ :vmpooler => {
380
+ 'template' => 'fedora-20-x86_64'
381
+ }
382
+ },
383
+ 'fedora21-32' => {
384
+ :general => {
385
+ 'platform' => 'fedora-21-i386'
386
+ },
387
+ :vmpooler => {
388
+ 'template' => 'fedora-21-i386'
389
+ }
390
+ },
391
+ 'fedora21-64' => {
392
+ :general => {
393
+ 'platform' => 'fedora-21-x86_64'
394
+ },
395
+ :vmpooler => {
396
+ 'template' => 'fedora-21-x86_64'
397
+ }
398
+ },
399
+ 'fedora22-32' => {
400
+ :general => {
401
+ 'platform' => 'fedora-22-i386'
402
+ },
403
+ :vmpooler => {
404
+ 'template' => 'fedora-22-i386'
405
+ }
406
+ },
407
+ 'fedora22-64' => {
408
+ :general => {
409
+ 'platform' => 'fedora-22-x86_64'
410
+ },
411
+ :vmpooler => {
412
+ 'template' => 'fedora-22-x86_64'
413
+ }
414
+ },
415
+ 'fedora23-32' => {
416
+ :general => {
417
+ 'platform' => 'fedora-23-i386'
418
+ },
419
+ :vmpooler => {
420
+ 'template' => 'fedora-23-i386'
421
+ }
422
+ },
423
+ 'fedora23-64' => {
424
+ :general => {
425
+ 'platform' => 'fedora-23-x86_64'
426
+ },
427
+ :vmpooler => {
428
+ 'template' => 'fedora-23-x86_64'
429
+ }
430
+ },
431
+ 'opensuse11-32' => {
432
+ :general => {
433
+ 'platform' => 'opensuse-11-i386'
434
+ },
435
+ :vmpooler => {
436
+ 'template' => 'opensuse-11-i386'
437
+ }
438
+ },
439
+ 'opensuse11-64' => {
440
+ :general => {
441
+ 'platform' => 'opensuse-11-x86_64'
442
+ },
443
+ :vmpooler => {
444
+ 'template' => 'opensuse-11-x86_64'
445
+ }
446
+ },
447
+ 'scientific5-32' => {
448
+ :general => {
449
+ 'platform' => 'el-5-i386'
450
+ },
451
+ :vmpooler => {
452
+ 'template' => 'scientific-5-i386'
453
+ }
454
+ },
455
+ 'scientific5-64' => {
456
+ :general => {
457
+ 'platform' => 'el-5-x86_64'
458
+ },
459
+ :vmpooler => {
460
+ 'template' => 'scientific-5-x86_64'
461
+ }
462
+ },
463
+ 'scientific6-32' => {
464
+ :general => {
465
+ 'platform' => 'el-6-i386'
466
+ },
467
+ :vmpooler => {
468
+ 'template' => 'scientific-6-i386'
469
+ }
470
+ },
471
+ 'scientific6-64' => {
472
+ :general => {
473
+ 'platform' => 'el-6-x86_64'
474
+ },
475
+ :vmpooler => {
476
+ 'template' => 'scientific-6-x86_64'
477
+ }
478
+ },
479
+ 'scientific7-64' => {
480
+ :general => {
481
+ 'platform' => 'el-7-x86_64'
482
+ },
483
+ :vmpooler => {
484
+ 'template' => 'scientific-7-x86_64'
485
+ }
486
+ },
487
+ 'sles10-32' => {
488
+ :general => {
489
+ 'platform' => 'sles-10-i386'
490
+ },
491
+ :vmpooler => {
492
+ 'template' => 'sles-10-i386'
493
+ }
494
+ },
495
+ 'sles10-64' => {
496
+ :general => {
497
+ 'platform' => 'sles-10-x86_64'
498
+ },
499
+ :vmpooler => {
500
+ 'template' => 'sles-10-x86_64'
501
+ }
502
+ },
503
+ 'sles11-32' => {
504
+ :general => {
505
+ 'platform' => 'sles-11-i386'
506
+ },
507
+ :vmpooler => {
508
+ 'template' => 'sles-11-i386'
509
+ }
510
+ },
511
+ 'sles11-64' => {
512
+ :general => {
513
+ 'platform' => 'sles-11-x86_64'
514
+ },
515
+ :vmpooler => {
516
+ 'template' => 'sles-11-x86_64'
517
+ }
518
+ },
519
+ 'sles12-64' => {
520
+ :general => {
521
+ 'platform' => 'sles-12-x86_64'
522
+ },
523
+ :vmpooler => {
524
+ 'template' => 'sles-12-x86_64'
525
+ }
526
+ },
527
+ 'solaris10-32' => {
528
+ :general => {
529
+ 'platform' => 'solaris-10-i386'
530
+ },
531
+ :vmpooler => {
532
+ 'template' => 'solaris-10-x86_64'
533
+ }
534
+ },
535
+ 'solaris10-64' => {
536
+ :general => {
537
+ 'platform' => 'solaris-10-i386'
538
+ },
539
+ :vmpooler => {
540
+ 'template' => 'solaris-10-x86_64'
541
+ }
542
+ },
543
+ 'solaris11-32' => {
544
+ :general => {
545
+ 'platform' => 'solaris-11-i386'
546
+ },
547
+ :vmpooler => {
548
+ 'template' => 'solaris-11-x86_64'
549
+ }
550
+ },
551
+ 'solaris11-64' => {
552
+ :general => {
553
+ 'platform' => 'solaris-11-i386'
554
+ },
555
+ :vmpooler => {
556
+ 'template' => 'solaris-11-x86_64'
557
+ }
558
+ },
559
+ 'solaris112-32' => {
560
+ :general => {
561
+ 'platform' => 'solaris-11.2-i386'
562
+ },
563
+ :vmpooler => {
564
+ 'template' => 'solaris-112-x86_64'
565
+ }
566
+ },
567
+ 'solaris112-64' => {
568
+ :general => {
569
+ 'platform' => 'solaris-11.2-i386'
570
+ },
571
+ :vmpooler => {
572
+ 'template' => 'solaris-112-x86_64'
573
+ }
574
+ },
575
+ 'ubuntu1004-32' => {
576
+ :general => {
577
+ 'platform' => 'ubuntu-10.04-i386'
578
+ },
579
+ :vmpooler => {
580
+ 'template' => 'ubuntu-1004-i386'
581
+ }
582
+ },
583
+ 'ubuntu1004-64' => {
584
+ :general => {
585
+ 'platform' => 'ubuntu-10.04-amd64'
586
+ },
587
+ :vmpooler => {
588
+ 'template' => 'ubuntu-1004-x86_64'
589
+ }
590
+ },
591
+ 'ubuntu1204-32' => {
592
+ :general => {
593
+ 'platform' => 'ubuntu-12.04-i386'
594
+ },
595
+ :vmpooler => {
596
+ 'template' => 'ubuntu-1204-i386'
597
+ }
598
+ },
599
+ 'ubuntu1204-64' => {
600
+ :general => {
601
+ 'platform' => 'ubuntu-12.04-amd64'
602
+ },
603
+ :vmpooler => {
604
+ 'template' => 'ubuntu-1204-x86_64'
605
+ }
606
+ },
607
+ 'ubuntu1404-32' => {
608
+ :general => {
609
+ 'platform' => 'ubuntu-14.04-i386'
610
+ },
611
+ :vmpooler => {
612
+ 'template' => 'ubuntu-1404-i386'
613
+ }
614
+ },
615
+ 'ubuntu1404-64' => {
616
+ :general => {
617
+ 'platform' => 'ubuntu-14.04-amd64'
618
+ },
619
+ :vmpooler => {
620
+ 'template' => 'ubuntu-1404-x86_64'
621
+ }
622
+ },
623
+ 'ubuntu1504-32' => {
624
+ :general => {
625
+ 'platform' => 'ubuntu-15.04-i386'
626
+ },
627
+ :vmpooler => {
628
+ 'template' => 'ubuntu-1504-i386'
629
+ }
630
+ },
631
+ 'ubuntu1504-64' => {
632
+ :general => {
633
+ 'platform' => 'ubuntu-15.04-amd64'
634
+ },
635
+ :vmpooler => {
636
+ 'template' => 'ubuntu-1504-x86_64'
637
+ }
638
+ },
639
+ 'ubuntu1510-32' => {
640
+ :general => {
641
+ 'platform' => 'ubuntu-15.10-i386'
642
+ },
643
+ :vmpooler => {
644
+ 'template' => 'ubuntu-1510-i386'
645
+ }
646
+ },
647
+ 'ubuntu1510-64' => {
648
+ :general => {
649
+ 'platform' => 'ubuntu-15.10-amd64'
650
+ },
651
+ :vmpooler => {
652
+ 'template' => 'ubuntu-1510-x86_64'
653
+ }
654
+ },
655
+ 'ubuntu1604-32' => {
656
+ :general => {
657
+ 'platform' => 'ubuntu-16.04-i386'
658
+ },
659
+ :vmpooler => {
660
+ 'template' => 'ubuntu-1604-i386'
661
+ }
662
+ },
663
+ 'ubuntu1604-64' => {
664
+ :general => {
665
+ 'platform' => 'ubuntu-16.04-amd64'
666
+ },
667
+ :vmpooler => {
668
+ 'template' => 'ubuntu-1604-x86_64'
669
+ }
670
+ },
671
+ 'windows2003-64' => {
672
+ :general => {
673
+ 'platform' => 'windows-2003-64',
674
+ 'ruby_arch' => 'x64'
675
+ },
676
+ :vmpooler => {
677
+ 'template' => 'win-2003-x86_64'
678
+ }
679
+ },
680
+ 'windows2003-6432' => {
681
+ :general => {
682
+ 'platform' => 'windows-2003-64',
683
+ 'ruby_arch' => 'x86'
684
+ },
685
+ :vmpooler => {
686
+ 'template' => 'win-2003-x86_64'
687
+ }
688
+ },
689
+ 'windows2003r2-32' => {
690
+ :general => {
691
+ 'platform' => 'windows-2003r2-32',
692
+ 'ruby_arch' => 'x86'
693
+ },
694
+ :vmpooler => {
695
+ 'template' => 'win-2003r2-i386'
696
+ }
697
+ },
698
+ 'windows2003r2-64' => {
699
+ :general => {
700
+ 'platform' => 'windows-2003r2-64',
701
+ 'ruby_arch' => 'x64'
702
+ },
703
+ :vmpooler => {
704
+ 'template' => 'win-2003r2-x86_64'
705
+ }
706
+ },
707
+ 'windows2003r2-6432' => {
708
+ :general => {
709
+ 'platform' => 'windows-2003r2-64',
710
+ 'ruby_arch' => 'x86'
711
+ },
712
+ :vmpooler => {
713
+ 'template' => 'win-2003r2-x86_64'
714
+ }
715
+ },
716
+ 'windows2008-64' => {
717
+ :general => {
718
+ 'platform' => 'windows-2008-64',
719
+ 'ruby_arch' => 'x64'
720
+ },
721
+ :vmpooler => {
722
+ 'template' => 'win-2008-x86_64'
723
+ }
724
+ },
725
+ 'windows2008-6432' => {
726
+ :general => {
727
+ 'platform' => 'windows-2008-64',
728
+ 'ruby_arch' => 'x86'
729
+ },
730
+ :vmpooler => {
731
+ 'template' => 'win-2008-x86_64'
732
+ }
733
+ },
734
+ 'windows2008r2-64' => {
735
+ :general => {
736
+ 'platform' => 'windows-2008r2-64',
737
+ 'ruby_arch' => 'x64'
738
+ },
739
+ :vmpooler => {
740
+ 'template' => 'win-2008r2-x86_64'
741
+ }
742
+ },
743
+ 'windows2008r2-6432' => {
744
+ :general => {
745
+ 'platform' => 'windows-2008r2-64',
746
+ 'ruby_arch' => 'x86'
747
+ },
748
+ :vmpooler => {
749
+ 'template' => 'win-2008r2-x86_64'
750
+ }
751
+ },
752
+ 'windows2012-64' => {
753
+ :general => {
754
+ 'platform' => 'windows-2012-64',
755
+ 'ruby_arch' => 'x64'
756
+ },
757
+ :vmpooler => {
758
+ 'template' => 'win-2012-x86_64'
759
+ }
760
+ },
761
+ 'windows2012-6432' => {
762
+ :general => {
763
+ 'platform' => 'windows-2012-64',
764
+ 'ruby_arch' => 'x86'
765
+ },
766
+ :vmpooler => {
767
+ 'template' => 'win-2012-x86_64'
768
+ }
769
+ },
770
+ 'windows2012r2-64' => {
771
+ :general => {
772
+ 'platform' => 'windows-2012r2-64',
773
+ 'ruby_arch' => 'x64'
774
+ },
775
+ :vmpooler => {
776
+ 'template' => 'win-2012r2-x86_64'
777
+ }
778
+ },
779
+ 'windows2012r2-6432' => {
780
+ :general => {
781
+ 'platform' => 'windows-2012r2-64',
782
+ 'ruby_arch' => 'x86'
783
+ },
784
+ :vmpooler => {
785
+ 'template' => 'win-2012r2-x86_64'
786
+ }
787
+ },
788
+ 'windows7-64' => {
789
+ :general => {
790
+ 'platform' => 'windows-7-64',
791
+ 'ruby_arch' => 'x64'
792
+ },
793
+ :vmpooler => {
794
+ 'template' => 'win-7-x86_64'
795
+ }
796
+ },
797
+ 'windows8-64' => {
798
+ :general => {
799
+ 'platform' => 'windows-8-64',
800
+ 'ruby_arch' => 'x64'
801
+ },
802
+ :vmpooler => {
803
+ 'template' => 'win-8-x86_64'
804
+ }
805
+ },
806
+ 'windows81-64' => {
807
+ :general => {
808
+ 'platform' => 'windows-8.1-64',
809
+ 'ruby_arch' => 'x64'
810
+ },
811
+ :vmpooler => {
812
+ 'template' => 'win-81-x86_64'
813
+ }
814
+ },
815
+ 'windowsvista-64' => {
816
+ :general => {
817
+ 'platform' => 'windows-vista-64',
818
+ 'ruby_arch' => 'x64'
819
+ },
820
+ :vmpooler => {
821
+ 'template' => 'win-vista-x86_64'
822
+ }
823
+ },
824
+ 'windows10ent-32' => {
825
+ :general => {
826
+ 'platform' => 'windows-10ent-32',
827
+ 'ruby_arch' => 'x86'
828
+ },
829
+ :vmpooler => {
830
+ 'template' => 'win-10-ent-i386'
831
+ }
832
+ },
833
+ 'windows10ent-64' => {
834
+ :general => {
835
+ 'platform' => 'windows-10ent-64',
836
+ 'ruby_arch' => 'x64'
837
+ },
838
+ :vmpooler => {
839
+ 'template' => 'win-10-ent-x86_64'
840
+ }
841
+ },
842
+ 'windows10pro-64' => {
843
+ :general => {
844
+ 'platform' => 'windows-10pro-64',
845
+ 'ruby_arch' => 'x64'
846
+ },
847
+ :vmpooler => {
848
+ 'template' => 'win-10-pro-x86_64'
849
+ },
850
+ }
851
+ }
852
+ end
853
+
854
+ def osinfo_bhgv1
855
+ {
856
+ 'centos4-32' => {
857
+ :general => {
858
+ 'platform' => 'centos-4-i386'
859
+ },
860
+ :vmpooler => {
861
+ 'template' => 'centos-4-i386'
862
+ }
863
+ },
864
+ 'centos4-64' => {
865
+ :general => {
866
+ 'platform' => 'centos-4-x86_64'
867
+ },
868
+ :vmpooler => {
869
+ 'template' => 'centos-4-x86_64'
870
+ }
871
+ },
872
+ 'centos5-32' => {
873
+ :general => {
874
+ 'platform' => 'centos-5-i386'
875
+ },
876
+ :vmpooler => {
877
+ 'template' => 'centos-5-i386'
878
+ }
879
+ },
880
+ 'centos5-64' => {
881
+ :general => {
882
+ 'platform' => 'centos-5-x86_64'
883
+ },
884
+ :vmpooler => {
885
+ 'template' => 'centos-5-x86_64'
886
+ }
887
+ },
888
+ 'centos6-32' => {
889
+ :general => {
890
+ 'platform' => 'centos-6-i386'
891
+ },
892
+ :vmpooler => {
893
+ 'template' => 'centos-6-i386'
894
+ }
895
+ },
896
+ 'centos6-64' => {
897
+ :general => {
898
+ 'platform' => 'centos-6-x86_64'
899
+ },
900
+ :vmpooler => {
901
+ 'template' => 'centos-6-x86_64'
902
+ }
903
+ },
904
+ 'centos7-64' => {
905
+ :general => {
906
+ 'platform' => 'centos-7-x86_64'
907
+ },
908
+ :vmpooler => {
909
+ 'template' => 'centos-7-x86_64'
910
+ }
911
+ }
912
+ }
913
+ end
914
+
915
+ # Returns the map of OS info for the given version of this library.
916
+ # The current version is always available as version 0 (zero).
917
+ # Throws an exception if the version number is unrecognized.
918
+ #
919
+ # This is intended to be the primary access point for the OS info maps
920
+ # defined in `osinfo`, `osinfo_bhgv1`, etc.
921
+ #
922
+ # See also `get_platforms`, `get_platform_info`, for common operations on
923
+ # this OS info map.
924
+ def get_osinfo(bhg_version)
925
+ case bhg_version
926
+ when 0
927
+ {}.deep_merge!(osinfo)
928
+ when 1
929
+ {}.deep_merge!(osinfo).deep_merge!(osinfo_bhgv1)
930
+ else
931
+ raise "Invalid beaker-hostgenerator version: #{bhg_version}"
932
+ end
933
+ end
934
+
935
+ # Returns the list of platforms supported by the specified version of this
936
+ # library. This list should be equal to the keys of the `get_osinfo` map
937
+ # and is provided as a common convenience.
938
+ def get_platforms(bhg_version)
939
+ get_osinfo(bhg_version).keys
940
+ end
941
+
942
+ # Returns the fully parsed map of information of the specified OS platform
943
+ # for the specified hypervisor. This map should be suitable for outputting
944
+ # to the user as it will have the intermediate organizational branches of
945
+ # the `get_osinfo` map removed.
946
+ #
947
+ # This is intended to be the primary way to access OS info from hypervisor
948
+ # implementations when generating host definitions.
949
+ #
950
+ # @param [Integer] bhg_version The version of OS info to use.
951
+ #
952
+ # @param [String] platform The OS platform to access from the OS info map.
953
+ #
954
+ # @param [Symbol] hypervisor The symbol representing which hypervisor submap
955
+ # to extract from the general OS info map.
956
+ #
957
+ # @example Getting CentOS 6 64-bit information for the VMPooler hypervisor
958
+ # Given the OS info map looks like:
959
+ # ...
960
+ # 'centos6-64' => {
961
+ # :general => { 'platform' => 'el-6-x86_64' },
962
+ # :vmpooler => { 'template' => 'centos-6-x86_64' }
963
+ # }
964
+ # ...
965
+ #
966
+ # Then get_platform_info(0, 'centos6-64', :vmpooler) returns:
967
+ # {
968
+ # 'platform' => 'el-6-x86_64',
969
+ # 'template' => 'centos-6-x86_64'
970
+ # }
971
+ def get_platform_info(bhg_version, platform, hypervisor)
972
+ info = get_osinfo(bhg_version)[platform]
973
+ {}.deep_merge!(info[:general]).deep_merge!(info[hypervisor])
974
+ end
975
+
976
+ # Perform any adjustments or modifications necessary to the given node
977
+ # configuration map, taking things like platform and PE version into
978
+ # account.
979
+ #
980
+ # This is intended to capture any oddities that are necessary for a node
981
+ # to be used in a particular context.
982
+ def fixup_node(cfg)
983
+ # PE 2.8 doesn't exist for EL 4. We use 2.0 instead.
984
+ if cfg['platform'] =~ /el-4/ and pe_version =~ /2\.8/
985
+ cfg['pe_ver'] = "2.0.3"
986
+ end
987
+ end
988
+
64
989
  end
65
990
  end