bebox 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (402) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +78 -0
  3. data/Gemfile +3 -0
  4. data/Gemfile.lock +163 -0
  5. data/LICENSE +21 -0
  6. data/README.md +372 -0
  7. data/Rakefile +8 -0
  8. data/bebox.gemspec +40 -0
  9. data/bin/bebox +5 -0
  10. data/lib/bebox/cli.rb +42 -0
  11. data/lib/bebox/commands/commands_helper.rb +33 -0
  12. data/lib/bebox/commands/environment_commands.rb +46 -0
  13. data/lib/bebox/commands/general_commands.rb +24 -0
  14. data/lib/bebox/commands/node_commands.rb +68 -0
  15. data/lib/bebox/commands/prepare_commands.rb +59 -0
  16. data/lib/bebox/commands/project_commands.rb +44 -0
  17. data/lib/bebox/commands/provision_commands.rb +145 -0
  18. data/lib/bebox/environment.rb +114 -0
  19. data/lib/bebox/logger.rb +51 -0
  20. data/lib/bebox/node.rb +308 -0
  21. data/lib/bebox/profile.rb +102 -0
  22. data/lib/bebox/project.rb +259 -0
  23. data/lib/bebox/provision.rb +257 -0
  24. data/lib/bebox/role.rb +103 -0
  25. data/lib/bebox/version.rb +3 -0
  26. data/lib/bebox/wizards/environment_wizard.rb +45 -0
  27. data/lib/bebox/wizards/node_wizard.rb +163 -0
  28. data/lib/bebox/wizards/profile_wizard.rb +91 -0
  29. data/lib/bebox/wizards/project_wizard.rb +175 -0
  30. data/lib/bebox/wizards/provision_wizard.rb +80 -0
  31. data/lib/bebox/wizards/role_wizard.rb +97 -0
  32. data/lib/bebox.rb +2 -0
  33. data/lib/deb/puppet_3.6.0/augeas-lenses_0.10.0-0ubuntu4_all.deb +0 -0
  34. data/lib/deb/puppet_3.6.0/debconf-utils_1.5.42ubuntu1_all.deb +0 -0
  35. data/lib/deb/puppet_3.6.0/facter_2.0.1-1puppetlabs1_amd64.deb +0 -0
  36. data/lib/deb/puppet_3.6.0/hiera_1.3.2-1puppetlabs1_all.deb +0 -0
  37. data/lib/deb/puppet_3.6.0/libaugeas-ruby1.8_0.3.0-1.1ubuntu4_amd64.deb +0 -0
  38. data/lib/deb/puppet_3.6.0/libaugeas-ruby_0.3.0-1.1ubuntu4_all.deb +0 -0
  39. data/lib/deb/puppet_3.6.0/libaugeas0_0.10.0-0ubuntu4_amd64.deb +0 -0
  40. data/lib/deb/puppet_3.6.0/libjson-ruby_1.6.3-1_all.deb +0 -0
  41. data/lib/deb/puppet_3.6.0/libruby1.8_1.8.7.352-2ubuntu1.4_amd64.deb +0 -0
  42. data/lib/deb/puppet_3.6.0/libruby_4.8_all.deb +0 -0
  43. data/lib/deb/puppet_3.6.0/libshadow-ruby1.8_1.4.1-8build1_amd64.deb +0 -0
  44. data/lib/deb/puppet_3.6.0/puppet-common_3.6.0-1puppetlabs1_all.deb +0 -0
  45. data/lib/deb/puppet_3.6.0/puppet_3.6.0-1puppetlabs1_all.deb +0 -0
  46. data/lib/deb/puppet_3.6.0/ruby-json_1.6.3-1_amd64.deb +0 -0
  47. data/lib/deb/puppet_3.6.0/ruby-rgen_0.6.5-1puppetlabs1_all.deb +0 -0
  48. data/lib/deb/puppet_3.6.0/ruby1.8_1.8.7.352-2ubuntu1.4_amd64.deb +0 -0
  49. data/lib/deb/puppet_3.6.0/ruby_4.8_all.deb +0 -0
  50. data/lib/deb/puppet_3.6.0/virt-what_1.11-1_amd64.deb +0 -0
  51. data/lib/templates/node/Vagrantfile.erb +18 -0
  52. data/lib/templates/node/deploy_vagrant_node.erb +3 -0
  53. data/lib/templates/node/node.yml.erb +3 -0
  54. data/lib/templates/node/prepared_node.yml.erb +4 -0
  55. data/lib/templates/node/provisioned_node.yml.erb +4 -0
  56. data/lib/templates/project/Capfile.erb +2 -0
  57. data/lib/templates/project/Gemfile.erb +5 -0
  58. data/lib/templates/project/config/deploy/environment.erb +40 -0
  59. data/lib/templates/project/config/deploy/vagrant.erb +42 -0
  60. data/lib/templates/project/config/deploy.erb +120 -0
  61. data/lib/templates/project/dot_bebox.erb +4 -0
  62. data/lib/templates/project/gitignore.erb +7 -0
  63. data/lib/templates/project/ubuntu_dependencies +10 -0
  64. data/lib/templates/puppet/default_profiles/base/fundamental/ruby/Puppetfile +0 -0
  65. data/lib/templates/puppet/default_profiles/base/fundamental/ruby/manifests/init.pp +24 -0
  66. data/lib/templates/puppet/default_profiles/base/fundamental/sudo/Puppetfile +0 -0
  67. data/lib/templates/puppet/default_profiles/base/fundamental/sudo/manifests/init.pp +22 -0
  68. data/lib/templates/puppet/default_profiles/base/fundamental/users/Puppetfile +0 -0
  69. data/lib/templates/puppet/default_profiles/base/fundamental/users/manifests/init.pp +18 -0
  70. data/lib/templates/puppet/default_profiles/base/security/fail2ban/Puppetfile +2 -0
  71. data/lib/templates/puppet/default_profiles/base/security/fail2ban/manifests/init.pp +28 -0
  72. data/lib/templates/puppet/default_profiles/base/security/iptables/Puppetfile +2 -0
  73. data/lib/templates/puppet/default_profiles/base/security/iptables/manifests/init.pp +27 -0
  74. data/lib/templates/puppet/default_profiles/base/security/ssh/Puppetfile +2 -0
  75. data/lib/templates/puppet/default_profiles/base/security/ssh/manifests/init.pp +30 -0
  76. data/lib/templates/puppet/default_profiles/base/security/sysctl/Puppetfile +2 -0
  77. data/lib/templates/puppet/default_profiles/base/security/sysctl/manifests/init.pp +20 -0
  78. data/lib/templates/puppet/default_profiles/base/users/ssh/Puppetfile +2 -0
  79. data/lib/templates/puppet/default_profiles/base/users/ssh/manifests/init.pp +47 -0
  80. data/lib/templates/puppet/default_profiles/base/users/users/Puppetfile +0 -0
  81. data/lib/templates/puppet/default_profiles/base/users/users/manifests/init.pp +18 -0
  82. data/lib/templates/puppet/default_roles/fundamental/manifests/init.pp +16 -0
  83. data/lib/templates/puppet/default_roles/security/manifests/init.pp +17 -0
  84. data/lib/templates/puppet/default_roles/users/manifests/init.pp +15 -0
  85. data/lib/templates/puppet/profiles/Puppetfile.erb +24 -0
  86. data/lib/templates/puppet/profiles/manifests/init.pp.erb +17 -0
  87. data/lib/templates/puppet/roles/manifests/init.pp.erb +14 -0
  88. data/lib/templates/puppet/step-0/Puppetfile.erb +5 -0
  89. data/lib/templates/puppet/step-0/hiera/data/common.yaml.erb +26 -0
  90. data/lib/templates/puppet/step-0/hiera/data/environment.yaml.erb +26 -0
  91. data/lib/templates/puppet/step-0/hiera/data/node.yaml.erb +26 -0
  92. data/lib/templates/puppet/step-0/hiera/hiera.yaml.erb +11 -0
  93. data/lib/templates/puppet/step-0/manifests/node.erb +5 -0
  94. data/lib/templates/puppet/step-0/manifests/site.pp.erb +15 -0
  95. data/lib/templates/puppet/step-0/modules/rbenv/AUTHORS +11 -0
  96. data/lib/templates/puppet/step-0/modules/rbenv/CHANGELOG.md +70 -0
  97. data/lib/templates/puppet/step-0/modules/rbenv/Gemfile +8 -0
  98. data/lib/templates/puppet/step-0/modules/rbenv/Gemfile.lock +28 -0
  99. data/lib/templates/puppet/step-0/modules/rbenv/Modulefile +7 -0
  100. data/lib/templates/puppet/step-0/modules/rbenv/README.md +173 -0
  101. data/lib/templates/puppet/step-0/modules/rbenv/Rakefile +22 -0
  102. data/lib/templates/puppet/step-0/modules/rbenv/TODO +10 -0
  103. data/lib/templates/puppet/step-0/modules/rbenv/bin/autospec +16 -0
  104. data/lib/templates/puppet/step-0/modules/rbenv/bin/facter +16 -0
  105. data/lib/templates/puppet/step-0/modules/rbenv/bin/filebucket +16 -0
  106. data/lib/templates/puppet/step-0/modules/rbenv/bin/hiera +16 -0
  107. data/lib/templates/puppet/step-0/modules/rbenv/bin/htmldiff +16 -0
  108. data/lib/templates/puppet/step-0/modules/rbenv/bin/ldiff +16 -0
  109. data/lib/templates/puppet/step-0/modules/rbenv/bin/pi +16 -0
  110. data/lib/templates/puppet/step-0/modules/rbenv/bin/puppet +16 -0
  111. data/lib/templates/puppet/step-0/modules/rbenv/bin/puppet-lint +16 -0
  112. data/lib/templates/puppet/step-0/modules/rbenv/bin/puppet-module +16 -0
  113. data/lib/templates/puppet/step-0/modules/rbenv/bin/puppetca +16 -0
  114. data/lib/templates/puppet/step-0/modules/rbenv/bin/puppetd +16 -0
  115. data/lib/templates/puppet/step-0/modules/rbenv/bin/puppetdoc +16 -0
  116. data/lib/templates/puppet/step-0/modules/rbenv/bin/puppetmasterd +16 -0
  117. data/lib/templates/puppet/step-0/modules/rbenv/bin/puppetqd +16 -0
  118. data/lib/templates/puppet/step-0/modules/rbenv/bin/puppetrun +16 -0
  119. data/lib/templates/puppet/step-0/modules/rbenv/bin/rake +16 -0
  120. data/lib/templates/puppet/step-0/modules/rbenv/bin/ralsh +16 -0
  121. data/lib/templates/puppet/step-0/modules/rbenv/bin/rspec +16 -0
  122. data/lib/templates/puppet/step-0/modules/rbenv/bin/rspec-puppet-init +16 -0
  123. data/lib/templates/puppet/step-0/modules/rbenv/lib/puppet/provider/rbenvgem/default.rb +50 -0
  124. data/lib/templates/puppet/step-0/modules/rbenv/lib/puppet/type/rbenvgem.rb +62 -0
  125. data/lib/templates/puppet/step-0/modules/rbenv/manifests/bundle.pp +36 -0
  126. data/lib/templates/puppet/step-0/modules/rbenv/manifests/client.pp +48 -0
  127. data/lib/templates/puppet/step-0/modules/rbenv/manifests/compile.pp +102 -0
  128. data/lib/templates/puppet/step-0/modules/rbenv/manifests/definition.pp +31 -0
  129. data/lib/templates/puppet/step-0/modules/rbenv/manifests/dependencies/centos.pp +25 -0
  130. data/lib/templates/puppet/step-0/modules/rbenv/manifests/dependencies/suse.pp +28 -0
  131. data/lib/templates/puppet/step-0/modules/rbenv/manifests/dependencies/ubuntu.pp +17 -0
  132. data/lib/templates/puppet/step-0/modules/rbenv/manifests/dependencies.pp +8 -0
  133. data/lib/templates/puppet/step-0/modules/rbenv/manifests/gem.pp +29 -0
  134. data/lib/templates/puppet/step-0/modules/rbenv/manifests/install.pp +55 -0
  135. data/lib/templates/puppet/step-0/modules/rbenv/manifests/plugin/rbenvvars.pp +16 -0
  136. data/lib/templates/puppet/step-0/modules/rbenv/manifests/plugin/rubybuild.pp +16 -0
  137. data/lib/templates/puppet/step-0/modules/rbenv/manifests/plugin.pp +40 -0
  138. data/lib/templates/puppet/step-0/modules/rbenv/metadata.json +109 -0
  139. data/lib/templates/puppet/step-0/modules/rbenv/templates/Gemfile.erb +5 -0
  140. data/lib/templates/puppet/step-0/modules/rbenv/templates/dot.rbenvrc.erb +8 -0
  141. data/lib/templates/puppet/step-0/modules/stdlib/CHANGELOG.md +418 -0
  142. data/lib/templates/puppet/step-0/modules/stdlib/CONTRIBUTING.md +65 -0
  143. data/lib/templates/puppet/step-0/modules/stdlib/Gemfile +33 -0
  144. data/lib/templates/puppet/step-0/modules/stdlib/Gemfile.lock +166 -0
  145. data/lib/templates/puppet/step-0/modules/stdlib/LICENSE +19 -0
  146. data/lib/templates/puppet/step-0/modules/stdlib/Modulefile +11 -0
  147. data/lib/templates/puppet/step-0/modules/stdlib/README.markdown +1304 -0
  148. data/lib/templates/puppet/step-0/modules/stdlib/README_DEVELOPER.markdown +35 -0
  149. data/lib/templates/puppet/step-0/modules/stdlib/README_SPECS.markdown +7 -0
  150. data/lib/templates/puppet/step-0/modules/stdlib/RELEASE_PROCESS.markdown +24 -0
  151. data/lib/templates/puppet/step-0/modules/stdlib/Rakefile +18 -0
  152. data/lib/templates/puppet/step-0/modules/stdlib/checksums.json +349 -0
  153. data/lib/templates/puppet/step-0/modules/stdlib/lib/facter/facter_dot_d.rb +202 -0
  154. data/lib/templates/puppet/step-0/modules/stdlib/lib/facter/pe_version.rb +53 -0
  155. data/lib/templates/puppet/step-0/modules/stdlib/lib/facter/puppet_vardir.rb +26 -0
  156. data/lib/templates/puppet/step-0/modules/stdlib/lib/facter/root_home.rb +32 -0
  157. data/lib/templates/puppet/step-0/modules/stdlib/lib/facter/util/puppet_settings.rb +21 -0
  158. data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/abs.rb +36 -0
  159. data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/any2array.rb +33 -0
  160. data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/base64.rb +37 -0
  161. data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/bool2num.rb +49 -0
  162. data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/capitalize.rb +34 -0
  163. data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/chomp.rb +35 -0
  164. data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/chop.rb +37 -0
  165. data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/concat.rb +41 -0
  166. data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/count.rb +22 -0
  167. data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/deep_merge.rb +44 -0
  168. data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/defined_with_params.rb +35 -0
  169. data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/delete.rb +46 -0
  170. data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/delete_at.rb +49 -0
  171. data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/delete_undef_values.rb +34 -0
  172. data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/delete_values.rb +26 -0
  173. data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/difference.rb +36 -0
  174. data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/dirname.rb +15 -0
  175. data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/downcase.rb +33 -0
  176. data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/empty.rb +28 -0
  177. data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/ensure_packages.rb +35 -0
  178. data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/ensure_resource.rb +45 -0
  179. data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/flatten.rb +33 -0
  180. data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/floor.rb +25 -0
  181. data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/fqdn_rotate.rb +46 -0
  182. data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/get_module_path.rb +17 -0
  183. data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/getparam.rb +35 -0
  184. data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/getvar.rb +26 -0
  185. data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/grep.rb +33 -0
  186. data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/has_interface_with.rb +52 -0
  187. data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/has_ip_address.rb +25 -0
  188. data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/has_ip_network.rb +25 -0
  189. data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/has_key.rb +28 -0
  190. data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/hash.rb +41 -0
  191. data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/intersection.rb +34 -0
  192. data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/is_array.rb +22 -0
  193. data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/is_bool.rb +22 -0
  194. data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/is_domain_name.rb +50 -0
  195. data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/is_float.rb +30 -0
  196. data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/is_function_available.rb +26 -0
  197. data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/is_hash.rb +22 -0
  198. data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/is_integer.rb +45 -0
  199. data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/is_ip_address.rb +32 -0
  200. data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/is_mac_address.rb +27 -0
  201. data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/is_numeric.rb +75 -0
  202. data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/is_string.rb +26 -0
  203. data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/join.rb +41 -0
  204. data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/join_keys_to_values.rb +47 -0
  205. data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/keys.rb +26 -0
  206. data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/loadyaml.rb +20 -0
  207. data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/lstrip.rb +33 -0
  208. data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/max.rb +21 -0
  209. data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/member.rb +44 -0
  210. data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/merge.rb +34 -0
  211. data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/min.rb +21 -0
  212. data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/num2bool.rb +43 -0
  213. data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/parsejson.rb +24 -0
  214. data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/parseyaml.rb +24 -0
  215. data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/pick.rb +29 -0
  216. data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/pick_default.rb +35 -0
  217. data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/prefix.rb +45 -0
  218. data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/range.rb +88 -0
  219. data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/reject.rb +31 -0
  220. data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/reverse.rb +28 -0
  221. data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/rstrip.rb +32 -0
  222. data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/shuffle.rb +46 -0
  223. data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/size.rb +48 -0
  224. data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/sort.rb +27 -0
  225. data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/squeeze.rb +36 -0
  226. data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/str2bool.rb +46 -0
  227. data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/str2saltedsha512.rb +32 -0
  228. data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/strftime.rb +107 -0
  229. data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/strip.rb +39 -0
  230. data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/suffix.rb +45 -0
  231. data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/swapcase.rb +39 -0
  232. data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/time.rb +49 -0
  233. data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/to_bytes.rb +28 -0
  234. data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/type.rb +50 -0
  235. data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/union.rb +34 -0
  236. data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/unique.rb +51 -0
  237. data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/upcase.rb +41 -0
  238. data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/uriescape.rb +35 -0
  239. data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/validate_absolute_path.rb +56 -0
  240. data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/validate_array.rb +33 -0
  241. data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/validate_augeas.rb +81 -0
  242. data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/validate_bool.rb +34 -0
  243. data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/validate_cmd.rb +48 -0
  244. data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/validate_hash.rb +33 -0
  245. data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/validate_ipv4_address.rb +48 -0
  246. data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/validate_ipv6_address.rb +49 -0
  247. data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/validate_re.rb +40 -0
  248. data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/validate_slength.rb +71 -0
  249. data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/validate_string.rb +33 -0
  250. data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/values.rb +39 -0
  251. data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/values_at.rb +98 -0
  252. data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/zip.rb +65 -0
  253. data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/provider/file_line/ruby.rb +83 -0
  254. data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/type/anchor.rb +46 -0
  255. data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/type/file_line.rb +79 -0
  256. data/lib/templates/puppet/step-0/modules/stdlib/manifests/init.pp +20 -0
  257. data/lib/templates/puppet/step-0/modules/stdlib/manifests/stages.pp +43 -0
  258. data/lib/templates/puppet/step-0/modules/stdlib/metadata.json +111 -0
  259. data/lib/templates/puppet/step-0/modules/sudo/.fixtures.yml +5 -0
  260. data/lib/templates/puppet/step-0/modules/sudo/.gemfile +14 -0
  261. data/lib/templates/puppet/step-0/modules/sudo/.gemfile.lock +43 -0
  262. data/lib/templates/puppet/step-0/modules/sudo/.travis.yml +34 -0
  263. data/lib/templates/puppet/step-0/modules/sudo/LICENSE +13 -0
  264. data/lib/templates/puppet/step-0/modules/sudo/Modulefile +9 -0
  265. data/lib/templates/puppet/step-0/modules/sudo/README.md +171 -0
  266. data/lib/templates/puppet/step-0/modules/sudo/Rakefile +1 -0
  267. data/lib/templates/puppet/step-0/modules/sudo/files/sudoers.aix +90 -0
  268. data/lib/templates/puppet/step-0/modules/sudo/files/sudoers.archlinux +90 -0
  269. data/lib/templates/puppet/step-0/modules/sudo/files/sudoers.deb +90 -0
  270. data/lib/templates/puppet/step-0/modules/sudo/files/sudoers.freebsd +98 -0
  271. data/lib/templates/puppet/step-0/modules/sudo/files/sudoers.omnios +90 -0
  272. data/lib/templates/puppet/step-0/modules/sudo/files/sudoers.rhel5 +97 -0
  273. data/lib/templates/puppet/step-0/modules/sudo/files/sudoers.rhel6 +115 -0
  274. data/lib/templates/puppet/step-0/modules/sudo/files/sudoers.solaris +90 -0
  275. data/lib/templates/puppet/step-0/modules/sudo/files/sudoers.suse +81 -0
  276. data/lib/templates/puppet/step-0/modules/sudo/files/sudoers.ubuntu +30 -0
  277. data/lib/templates/puppet/step-0/modules/sudo/files/sudoers.wheezy +17 -0
  278. data/lib/templates/puppet/step-0/modules/sudo/lib/augeas/lenses/fixedsudoers.aug +520 -0
  279. data/lib/templates/puppet/step-0/modules/sudo/manifests/allow.pp +76 -0
  280. data/lib/templates/puppet/step-0/modules/sudo/manifests/conf.pp +105 -0
  281. data/lib/templates/puppet/step-0/modules/sudo/manifests/configs.pp +24 -0
  282. data/lib/templates/puppet/step-0/modules/sudo/manifests/init.pp +151 -0
  283. data/lib/templates/puppet/step-0/modules/sudo/manifests/package/aix.pp +46 -0
  284. data/lib/templates/puppet/step-0/modules/sudo/manifests/package/solaris.pp +60 -0
  285. data/lib/templates/puppet/step-0/modules/sudo/manifests/package.pp +61 -0
  286. data/lib/templates/puppet/step-0/modules/sudo/manifests/params.pp +127 -0
  287. data/lib/templates/puppet/step-0/modules/sudo/metadata.json +59 -0
  288. data/lib/templates/puppet/step-0/modules/sudo/templates/users_groups.erb +9 -0
  289. data/lib/templates/puppet/step-0/modules/users/manifests/init.pp +15 -0
  290. data/lib/templates/puppet/step-0/modules/users/manifests/user.pp +50 -0
  291. data/lib/templates/puppet/step-1/Puppetfile.erb +5 -0
  292. data/lib/templates/puppet/step-1/hiera/data/common.yaml.erb +11 -0
  293. data/lib/templates/puppet/step-1/hiera/data/environment.yaml.erb +11 -0
  294. data/lib/templates/puppet/step-1/hiera/data/node.yaml.erb +11 -0
  295. data/lib/templates/puppet/step-1/hiera/hiera.yaml.erb +11 -0
  296. data/lib/templates/puppet/step-1/manifests/node.erb +5 -0
  297. data/lib/templates/puppet/step-1/manifests/site.pp.erb +15 -0
  298. data/lib/templates/puppet/step-1/modules/users/manifests/init.pp +15 -0
  299. data/lib/templates/puppet/step-1/modules/users/manifests/user.pp +49 -0
  300. data/lib/templates/puppet/step-2/Puppetfile.erb +5 -0
  301. data/lib/templates/puppet/step-2/hiera/data/common.yaml.erb +1 -0
  302. data/lib/templates/puppet/step-2/hiera/data/environment.yaml.erb +1 -0
  303. data/lib/templates/puppet/step-2/hiera/data/node.yaml.erb +1 -0
  304. data/lib/templates/puppet/step-2/hiera/hiera.yaml.erb +11 -0
  305. data/lib/templates/puppet/step-2/manifests/node.erb +3 -0
  306. data/lib/templates/puppet/step-2/manifests/site.pp.erb +10 -0
  307. data/lib/templates/puppet/step-3/Puppetfile.erb +5 -0
  308. data/lib/templates/puppet/step-3/hiera/data/common.yaml.erb +99 -0
  309. data/lib/templates/puppet/step-3/hiera/data/environment.yaml.erb +99 -0
  310. data/lib/templates/puppet/step-3/hiera/data/node.yaml.erb +99 -0
  311. data/lib/templates/puppet/step-3/hiera/hiera.yaml.erb +11 -0
  312. data/lib/templates/puppet/step-3/manifests/node.erb +5 -0
  313. data/lib/templates/puppet/step-3/manifests/site.pp.erb +15 -0
  314. data/spec/environment_spec.rb +82 -0
  315. data/spec/factories/environment.rb +20 -0
  316. data/spec/factories/node.rb +22 -0
  317. data/spec/factories/profile.rb +10 -0
  318. data/spec/factories/project.rb +17 -0
  319. data/spec/factories/provision.rb +13 -0
  320. data/spec/factories/role.rb +9 -0
  321. data/spec/fixtures/Capfile.test +2 -0
  322. data/spec/fixtures/Gemfile.test +5 -0
  323. data/spec/fixtures/config/deploy/environment.test +35 -0
  324. data/spec/fixtures/config/deploy/production.test +35 -0
  325. data/spec/fixtures/config/deploy/staging.test +35 -0
  326. data/spec/fixtures/config/deploy/vagrant.test +37 -0
  327. data/spec/fixtures/config/deploy.test +120 -0
  328. data/spec/fixtures/dot_bebox.test.erb +4 -0
  329. data/spec/fixtures/dot_gitignore.test +8 -0
  330. data/spec/fixtures/node/Vagrantfile.test.erb +18 -0
  331. data/spec/fixtures/node/node_0.test.erb +3 -0
  332. data/spec/fixtures/node/prepared_node_0.test.erb +4 -0
  333. data/spec/fixtures/node/provisioned_node_0.test.erb +4 -0
  334. data/spec/fixtures/node/vagrant_deploy.test +38 -0
  335. data/spec/fixtures/puppet/hiera/data/node0.server1.test.yaml.test +4 -0
  336. data/spec/fixtures/puppet/profiles/test/profile_0/Puppetfile.test +24 -0
  337. data/spec/fixtures/puppet/profiles/test/profile_0/Puppetfile_with_modules.test +20 -0
  338. data/spec/fixtures/puppet/profiles/test/profile_0/manifests/init.pp.test +17 -0
  339. data/spec/fixtures/puppet/profiles/test/profile_0/manifests/init_with_content.pp.test +22 -0
  340. data/spec/fixtures/puppet/roles/manifests/init.pp.test +14 -0
  341. data/spec/fixtures/puppet/steps/step-0/hiera/data/common.yaml.test +26 -0
  342. data/spec/fixtures/puppet/steps/step-0/hiera/data/node0.server1.test.yaml.test +0 -0
  343. data/spec/fixtures/puppet/steps/step-0/hiera/data/pname_env.yaml.test +26 -0
  344. data/spec/fixtures/puppet/steps/step-0/hiera/data/production.yaml.test +0 -0
  345. data/spec/fixtures/puppet/steps/step-0/hiera/data/staging.yaml.test +0 -0
  346. data/spec/fixtures/puppet/steps/step-0/hiera/data/vagrant.yaml.test +0 -0
  347. data/spec/fixtures/puppet/steps/step-0/hiera/hiera.yaml.test +11 -0
  348. data/spec/fixtures/puppet/steps/step-0/manifests/site.pp.test +10 -0
  349. data/spec/fixtures/puppet/steps/step-0/manifests/site_with_node.pp.test +15 -0
  350. data/spec/fixtures/puppet/steps/step-1/hiera/data/common.yaml.test +11 -0
  351. data/spec/fixtures/puppet/steps/step-1/hiera/data/node0.server1.test.yaml.test +0 -0
  352. data/spec/fixtures/puppet/steps/step-1/hiera/data/pname_env.yaml.test +11 -0
  353. data/spec/fixtures/puppet/steps/step-1/hiera/data/production.yaml.test +0 -0
  354. data/spec/fixtures/puppet/steps/step-1/hiera/data/staging.yaml.test +0 -0
  355. data/spec/fixtures/puppet/steps/step-1/hiera/data/vagrant.yaml.test +0 -0
  356. data/spec/fixtures/puppet/steps/step-1/hiera/hiera.yaml.test +11 -0
  357. data/spec/fixtures/puppet/steps/step-1/manifests/site.pp.test +10 -0
  358. data/spec/fixtures/puppet/steps/step-1/manifests/site_with_node.pp.test +15 -0
  359. data/spec/fixtures/puppet/steps/step-2/Puppetfile.test +6 -0
  360. data/spec/fixtures/puppet/steps/step-2/hiera/data/common.yaml.test +1 -0
  361. data/spec/fixtures/puppet/steps/step-2/hiera/data/node0.server1.test.yaml.test +1 -0
  362. data/spec/fixtures/puppet/steps/step-2/hiera/data/pname_env.yaml.test +1 -0
  363. data/spec/fixtures/puppet/steps/step-2/hiera/data/production.yaml.test +1 -0
  364. data/spec/fixtures/puppet/steps/step-2/hiera/data/staging.yaml.test +1 -0
  365. data/spec/fixtures/puppet/steps/step-2/hiera/data/vagrant.yaml.test +1 -0
  366. data/spec/fixtures/puppet/steps/step-2/hiera/hiera.yaml.test +11 -0
  367. data/spec/fixtures/puppet/steps/step-2/manifests/site.pp.test +10 -0
  368. data/spec/fixtures/puppet/steps/step-2/manifests/site_with_node.pp.test +13 -0
  369. data/spec/fixtures/puppet/steps/step-2/manifests/site_with_node_role_association.pp.test +16 -0
  370. data/spec/fixtures/puppet/steps/step-2/modules/profiles/manifests/test/profile_0.pp.test +17 -0
  371. data/spec/fixtures/puppet/steps/step-2/modules/roles/manifests/role_0.pp.test +16 -0
  372. data/spec/fixtures/puppet/steps/step-3/hiera/data/common.yaml.test +99 -0
  373. data/spec/fixtures/puppet/steps/step-3/hiera/data/node0.server1.test.yaml.test +1 -0
  374. data/spec/fixtures/puppet/steps/step-3/hiera/data/pname_env.yaml.test +99 -0
  375. data/spec/fixtures/puppet/steps/step-3/hiera/data/production.yaml.test +1 -0
  376. data/spec/fixtures/puppet/steps/step-3/hiera/data/staging.yaml.test +1 -0
  377. data/spec/fixtures/puppet/steps/step-3/hiera/data/vagrant.yaml.test +1 -0
  378. data/spec/fixtures/puppet/steps/step-3/hiera/hiera.yaml.test +11 -0
  379. data/spec/fixtures/puppet/steps/step-3/manifests/site.pp.test +10 -0
  380. data/spec/fixtures/puppet/steps/step-3/manifests/site_with_node.pp.test +15 -0
  381. data/spec/fixtures/puppet/ubuntu_dependencies.test +10 -0
  382. data/spec/node0.server1.test/prepare_phase_spec.rb +53 -0
  383. data/spec/node0.server1.test/provision_step_0_spec.rb +46 -0
  384. data/spec/node0.server1.test/provision_step_1_spec.rb +41 -0
  385. data/spec/node0.server1.test/provision_step_2_spec.rb +79 -0
  386. data/spec/node0.server1.test/provision_step_3_spec.rb +76 -0
  387. data/spec/node_role_spec.rb +20 -0
  388. data/spec/node_spec.rb +71 -0
  389. data/spec/node_wizard_spec.rb +22 -0
  390. data/spec/ordered_phases_spec.rb +55 -0
  391. data/spec/pre_prepare_spec.rb +78 -0
  392. data/spec/pre_provision_steps_spec.rb +40 -0
  393. data/spec/profile_spec.rb +70 -0
  394. data/spec/project_spec.rb +195 -0
  395. data/spec/project_wizard_spec.rb +51 -0
  396. data/spec/puppet_spec_helper.rb +15 -0
  397. data/spec/role_profiles_spec.rb +40 -0
  398. data/spec/role_spec.rb +56 -0
  399. data/spec/spec_helper.rb +37 -0
  400. data/spec/support/config_specs.yaml.example +2 -0
  401. data/spec/vagrant_spec_helper.rb +15 -0
  402. metadata +625 -0
@@ -0,0 +1,36 @@
1
+ define rbenv::bundle(
2
+ $home,
3
+ $user,
4
+ $group = $user,
5
+ $content = '',
6
+ $gems = ''
7
+ ) {
8
+
9
+ if ( $gems ) {
10
+ $gemfile = template('rbenv/Gemfile.erb')
11
+ } elsif ( $content ) {
12
+ $gemfile = $content
13
+ } else {
14
+ fail('bundle requires either a gem list or a Gemfile')
15
+ }
16
+
17
+ file {"${user}/Gemfile":
18
+ ensure => present,
19
+ path => "${home}/Gemfile",
20
+ owner => $user,
21
+ group => $group,
22
+ content => $gemfile,
23
+ backup => false,
24
+ require => Rbenv::Client[$user],
25
+ }
26
+
27
+ exec {"${user} bundle":
28
+ command => "bundle --binstubs=${home}/bin --path=${home}/.bundle",
29
+ cwd => $home,
30
+ user => $user,
31
+ group => $group,
32
+ path => "${home}/bin:${home}/.rbenv/shims:/bin:/usr/bin",
33
+ creates => "${home}/Gemfile.lock",
34
+ subscribe => File["${user}/Gemfile"],
35
+ }
36
+ }
@@ -0,0 +1,48 @@
1
+ define rbenv::client(
2
+ $user,
3
+ $home,
4
+ $ruby,
5
+ $owner,
6
+ $source,
7
+ $rc = ".profile"
8
+ ) {
9
+ if ! defined(Exec["rbenv::compile ${owner} ${ruby}"]) {
10
+ fail("Ruby version ${ruby} is not compiled for ${owner}")
11
+ }
12
+
13
+ file {"${user}/.rbenv":
14
+ ensure => link,
15
+ path => "${home}/.rbenv",
16
+ target => "${source}/.rbenv",
17
+ }
18
+
19
+ file {"${user}/${rc}":
20
+ ensure => link,
21
+ path => "${home}/${rc}",
22
+ target => "${source}/${rc}",
23
+ }
24
+
25
+ file {"${user}/.gemrc":
26
+ ensure => link,
27
+ path => "${home}/.gemrc",
28
+ target => "${source}/.gemrc",
29
+ }
30
+
31
+ file {"${user}/.rbenv-version":
32
+ ensure => present,
33
+ path => "${home}/.rbenv-version",
34
+ content => "$ruby\n",
35
+ }
36
+
37
+ file {"${user}/bin":
38
+ ensure => directory,
39
+ path => "${home}/bin",
40
+ owner => $user,
41
+ }
42
+
43
+ file {"${user}/bin/rbenv":
44
+ ensure => link,
45
+ path => "${home}/bin/rbenv",
46
+ target => "${source}/.rbenv/bin/rbenv",
47
+ }
48
+ }
@@ -0,0 +1,102 @@
1
+ # The following part compiles and installs the chosen ruby version,
2
+ # using the "ruby-build" rbenv plugin.
3
+ #
4
+ define rbenv::compile(
5
+ $user,
6
+ $ruby = $title,
7
+ $group = $user,
8
+ $home = '',
9
+ $root = '',
10
+ $source = '',
11
+ $global = false,
12
+ $configure_opts = '--disable-install-doc',
13
+ ) {
14
+
15
+ # Workaround http://projects.puppetlabs.com/issues/9848
16
+ $home_path = $home ? { '' => "/home/${user}", default => $home }
17
+ $root_path = $root ? { '' => "${home_path}/.rbenv", default => $root }
18
+
19
+ $bin = "${root_path}/bin"
20
+ $shims = "${root_path}/shims"
21
+ $versions = "${root_path}/versions"
22
+ $global_path = "${root_path}/version"
23
+ $path = [ $shims, $bin, '/bin', '/usr/bin' ]
24
+
25
+ if ! defined( Class['rbenv::dependencies'] ) {
26
+ require rbenv::dependencies
27
+ }
28
+
29
+ # If no ruby-build has been specified and the default resource hasn't been
30
+ # parsed
31
+ $custom_or_default = Rbenv::Plugin["rbenv::plugin::rubybuild::${user}"]
32
+ $default = Rbenv::Plugin::Rubybuild["rbenv::rubybuild::${user}"]
33
+ if ! defined($custom_or_default) and ! defined($default) {
34
+ debug("No ruby-build found for ${user}, going to add the default one")
35
+ rbenv::plugin::rubybuild { "rbenv::rubybuild::${user}":
36
+ user => $user,
37
+ group => $group,
38
+ home => $home,
39
+ root => $root
40
+ }
41
+ }
42
+
43
+ if $source {
44
+ rbenv::definition { "rbenv::definition ${user} ${ruby}":
45
+ user => $user,
46
+ group => $group,
47
+ source => $source,
48
+ ruby => $ruby,
49
+ home => $home,
50
+ root => $root,
51
+ require => Rbenv::Plugin["rbenv::plugin::rubybuild::${user}"],
52
+ before => Exec["rbenv::compile ${user} ${ruby}"]
53
+ }
54
+ }
55
+
56
+ # Set Timeout to disabled cause we need a lot of time to compile.
57
+ # Use HOME variable and define PATH correctly.
58
+ exec { "rbenv::compile ${user} ${ruby}":
59
+ command => "rbenv install ${ruby} && touch ${root_path}/.rehash",
60
+ timeout => 0,
61
+ user => $user,
62
+ group => $group,
63
+ cwd => $home_path,
64
+ environment => [ "HOME=${home_path}", "CONFIGURE_OPTS=${configure_opts}" ],
65
+ creates => "${versions}/${ruby}",
66
+ path => $path,
67
+ require => Rbenv::Plugin["rbenv::plugin::rubybuild::${user}"],
68
+ before => Exec["rbenv::rehash ${user} ${ruby}"],
69
+ }
70
+
71
+ exec { "rbenv::rehash ${user} ${ruby}":
72
+ command => "rbenv rehash && rm -f ${root_path}/.rehash",
73
+ user => $user,
74
+ group => $group,
75
+ cwd => $home_path,
76
+ onlyif => "[ -e '${root_path}/.rehash' ]",
77
+ environment => [ "HOME=${home_path}" ],
78
+ path => $path,
79
+ }
80
+
81
+ # Install bundler
82
+ #
83
+ rbenv::gem {"rbenv::bundler ${user} ${ruby}":
84
+ user => $user,
85
+ ruby => $ruby,
86
+ gem => 'bundler',
87
+ home => $home_path,
88
+ root => $root_path,
89
+ }
90
+
91
+ # Set default global ruby version for rbenv, if requested
92
+ #
93
+ if $global {
94
+ file { "rbenv::global ${user}":
95
+ path => $global_path,
96
+ content => "$ruby\n",
97
+ owner => $user,
98
+ group => $group,
99
+ require => Exec["rbenv::compile ${user} ${ruby}"]
100
+ }
101
+ }
102
+ }
@@ -0,0 +1,31 @@
1
+ define rbenv::definition(
2
+ $user,
3
+ $source,
4
+ $ruby = $title,
5
+ $group = $user,
6
+ $home = '',
7
+ $root = ''
8
+ ) {
9
+
10
+ $home_path = $home ? { '' => "/home/${user}", default => $home }
11
+ $root_path = $root ? { '' => "${home_path}/.rbenv", default => $root }
12
+
13
+ $destination = "${root_path}/plugins/ruby-build/share/ruby-build/${ruby}"
14
+
15
+ if $source =~ /^puppet:/ {
16
+ file { "rbenv::definition-file ${user} ${ruby}":
17
+ ensure => file,
18
+ source => $source,
19
+ group => $group,
20
+ path => $destination,
21
+ require => Exec["rbenv::plugin::checkout ${user} ruby-build"],
22
+ }
23
+ } elsif $source =~ /http(s)?:/ {
24
+ exec { "rbenv::definition-file ${user} ${ruby}":
25
+ command => "wget ${source} -O ${destination}",
26
+ creates => $destination,
27
+ user => $user,
28
+ require => Exec["rbenv::plugin::checkout ${user} ruby-build"],
29
+ }
30
+ }
31
+ }
@@ -0,0 +1,25 @@
1
+ class rbenv::dependencies::centos {
2
+
3
+ # These are the "build essentials" for RHEL / CentOS
4
+ if ! defined(Package['autoconf']) { package { 'autoconf': ensure => installed } }
5
+ if ! defined(Package['automake']) { package { 'automake': ensure => installed } }
6
+ if ! defined(Package['binutils']) { package { 'binutils': ensure => installed } }
7
+ if ! defined(Package['bison']) { package { 'bison': ensure => installed } }
8
+ if ! defined(Package['flex']) { package { 'flex': ensure => installed } }
9
+ if ! defined(Package['gcc']) { package { 'gcc': ensure => installed } }
10
+ if ! defined(Package['gcc-c++']) { package { 'gcc-c++': ensure => installed } }
11
+ if ! defined(Package['gettext']) { package { 'gettext': ensure => installed } }
12
+ if ! defined(Package['libtool']) { package { 'libtool': ensure => installed } }
13
+ if ! defined(Package['make']) { package { 'make': ensure => installed } }
14
+ if ! defined(Package['patch']) { package { 'patch': ensure => installed } }
15
+ if ! defined(Package['pkgconfig']) { package { 'pkgconfig': ensure => installed } }
16
+
17
+ # Other packages required to build a proper Ruby
18
+ if ! defined(Package['readline-devel']) { package { 'readline-devel': ensure => installed } }
19
+ if ! defined(Package['openssl-devel']) { package { 'openssl-devel': ensure => installed } }
20
+ if ! defined(Package['zlib-devel']) { package { 'zlib-devel': ensure => installed } }
21
+
22
+ # Git and curl are needed for rbenv and ruby-build
23
+ if ! defined(Package['git']) { package { 'git': ensure => installed } }
24
+ if ! defined(Package['curl']) { package { 'curl': ensure => installed } }
25
+ }
@@ -0,0 +1,28 @@
1
+ class rbenv::dependencies::suse {
2
+
3
+ # These are the "build essentials" for SuSE
4
+ if ! defined(Package['autoconf']) { package { 'autoconf' : ensure => installed } }
5
+ if ! defined(Package['automake']) { package { 'automake' : ensure => installed } }
6
+ if ! defined(Package['binutils']) { package { 'binutils' : ensure => installed } }
7
+ if ! defined(Package['bison']) { package { 'bison' : ensure => installed } }
8
+ if ! defined(Package['flex']) { package { 'flex' : ensure => installed } }
9
+ if ! defined(Package['gcc']) { package { 'gcc' : ensure => installed } }
10
+ if ! defined(Package['gcc-c++']) { package { 'gcc-c++' : ensure => installed } }
11
+ if ! defined(Package['gettext']) { package { 'gettext' : ensure => installed, name => 'gettext-tools' } }
12
+ if ! defined(Package['libtool']) { package { 'libtool' : ensure => installed } }
13
+ if ! defined(Package['make']) { package { 'make' : ensure => installed } }
14
+ if ! defined(Package['patch']) { package { 'patch' : ensure => installed } }
15
+ if ! defined(Package['pkgconfig']) { package { 'pkgconfig': ensure => installed, name => 'pkg-config' } }
16
+
17
+ # Other packages required to build a proper Ruby
18
+ if ! defined(Package['readline-devel']) { package { 'readline-devel': ensure => installed } }
19
+ if ! defined(Package['openssl-devel']) { package { 'openssl-devel' : ensure => installed, name => 'libopenssl-devel'} }
20
+ if ! defined(Package['zlib-devel']) { package { 'zlib-devel' : ensure => installed } }
21
+ if ! defined(Package['libyaml-devel']) { package { 'libyaml-devel' : ensure => installed } }
22
+ if ! defined(Package['ncurses-devel']) { package { 'ncurses-devel' : ensure => installed } }
23
+
24
+ # Git and curl are needed for rbenv and ruby-build
25
+ if ! defined(Package['git']) { package { 'git' : ensure => installed } }
26
+ if ! defined(Package['curl']) { package { 'curl' : ensure => installed } }
27
+
28
+ }
@@ -0,0 +1,17 @@
1
+ class rbenv::dependencies::ubuntu {
2
+ if ! defined(Package['build-essential']) { package { 'build-essential': ensure => installed } }
3
+ if ! defined(Package['libc6-dev']) { package { 'libc6-dev': ensure => installed } }
4
+ if ! defined(Package['bison']) { package { 'bison': ensure => installed } }
5
+ if ! defined(Package['openssl']) { package { 'openssl': ensure => installed } }
6
+ if ! defined(Package['libreadline6']) { package { 'libreadline6': ensure => installed } }
7
+ if ! defined(Package['libreadline6-dev']) { package { 'libreadline6-dev': ensure => installed } }
8
+ if ! defined(Package['zlib1g']) { package { 'zlib1g': ensure => installed } }
9
+ if ! defined(Package['zlib1g-dev']) { package { 'zlib1g-dev': ensure => installed } }
10
+ if ! defined(Package['libssl-dev']) { package { 'libssl-dev': ensure => installed } }
11
+ if ! defined(Package['libyaml-dev']) { package { 'libyaml-dev': ensure => installed } }
12
+ if ! defined(Package['libxml2-dev']) { package { 'libxml2-dev': ensure => installed } }
13
+ if ! defined(Package['libxslt1-dev']) { package { 'libxslt1-dev': ensure => installed, alias =>'libxslt-dev' } }
14
+ if ! defined(Package['autoconf']) { package { 'autoconf': ensure => installed } }
15
+ if ! defined(Package['git']) { package { 'git': ensure => installed, name => 'git-core' } }
16
+ if ! defined(Package['curl']) { package { 'curl': ensure => installed } }
17
+ }
@@ -0,0 +1,8 @@
1
+ class rbenv::dependencies {
2
+ case $::osfamily {
3
+ debian : { require rbenv::dependencies::ubuntu }
4
+ redhat : { require rbenv::dependencies::centos }
5
+ suse : { require rbenv::dependencies::suse }
6
+ default : { notice("Could not load dependencies for ${::osfamily}") }
7
+ }
8
+ }
@@ -0,0 +1,29 @@
1
+ # Install a gem under rbenv for a certain user's ruby version.
2
+ # Requires rbenv::compile for the passed in user and ruby version
3
+ #
4
+ define rbenv::gem(
5
+ $user,
6
+ $ruby,
7
+ $gem = $title,
8
+ $home = '',
9
+ $root = '',
10
+ $ensure = present
11
+ ) {
12
+
13
+ # Workaround http://projects.puppetlabs.com/issues/9848
14
+ $home_path = $home ? { '' => "/home/${user}", default => $home }
15
+ $root_path = $root ? { '' => "${home_path}/.rbenv", default => $root }
16
+
17
+ if ! defined( Exec["rbenv::compile ${user} ${ruby}"] ) {
18
+ fail("Rbenv-Ruby ${ruby} for user ${user} not found in catalog")
19
+ }
20
+
21
+ rbenvgem {"${user}/${ruby}/${gem}/${ensure}":
22
+ ensure => $ensure,
23
+ user => $user,
24
+ gemname => $gem,
25
+ ruby => $ruby,
26
+ rbenv => "${root_path}/versions/${ruby}",
27
+ require => Exec["rbenv::compile ${user} ${ruby}"],
28
+ }
29
+ }
@@ -0,0 +1,55 @@
1
+ define rbenv::install(
2
+ $user = $title,
3
+ $group = $user,
4
+ $home = '',
5
+ $root = '',
6
+ $rc = ".profile"
7
+ ) {
8
+
9
+ # Workaround http://projects.puppetlabs.com/issues/9848
10
+ $home_path = $home ? { '' => "/home/${user}", default => $home }
11
+ $root_path = $root ? { '' => "${home_path}/.rbenv", default => $root }
12
+
13
+ $rbenvrc = "${home_path}/.rbenvrc"
14
+ $shrc = "${home_path}/${rc}"
15
+
16
+ if ! defined( Class['rbenv::dependencies'] ) {
17
+ require rbenv::dependencies
18
+ }
19
+
20
+ exec { "rbenv::checkout ${user}":
21
+ command => "git clone git://github.com/sstephenson/rbenv.git ${root_path}",
22
+ user => $user,
23
+ group => $group,
24
+ creates => $root_path,
25
+ path => ['/usr/bin', '/usr/sbin'],
26
+ timeout => 100,
27
+ cwd => $home_path,
28
+ require => Package['git'],
29
+ }
30
+
31
+ file { "rbenv::rbenvrc ${user}":
32
+ path => $rbenvrc,
33
+ owner => $user,
34
+ group => $group,
35
+ content => template('rbenv/dot.rbenvrc.erb'),
36
+ require => Exec["rbenv::checkout ${user}"],
37
+ }
38
+
39
+ exec { "rbenv::shrc ${user}":
40
+ command => "echo 'source ${rbenvrc}' >> ${shrc}",
41
+ user => $user,
42
+ group => $group,
43
+ unless => "grep -q rbenvrc ${shrc}",
44
+ path => ['/bin', '/usr/bin', '/usr/sbin'],
45
+ require => File["rbenv::rbenvrc ${user}"],
46
+ }
47
+
48
+ file { "rbenv::cache-dir ${user}":
49
+ owner => $user,
50
+ group => $group,
51
+ ensure => directory,
52
+ path => "${root_path}/cache",
53
+ require => Exec["rbenv::checkout ${user}"]
54
+ }
55
+ }
@@ -0,0 +1,16 @@
1
+ define rbenv::plugin::rbenvvars(
2
+ $user = $title,
3
+ $source = 'git://github.com/sstephenson/rbenv-vars.git',
4
+ $group = $user,
5
+ $home = '',
6
+ $root = ''
7
+ ) {
8
+ rbenv::plugin { "rbenv::plugin::rbenvvars::${user}":
9
+ user => $user,
10
+ source => $source,
11
+ plugin_name => 'rbenv-vars',
12
+ group => $group,
13
+ home => $home,
14
+ root => $root
15
+ }
16
+ }
@@ -0,0 +1,16 @@
1
+ define rbenv::plugin::rubybuild(
2
+ $user = $title,
3
+ $source = 'git://github.com/sstephenson/ruby-build.git',
4
+ $group = $user,
5
+ $home = '',
6
+ $root = ''
7
+ ) {
8
+ rbenv::plugin { "rbenv::plugin::rubybuild::${user}":
9
+ user => $user,
10
+ source => $source,
11
+ plugin_name => 'ruby-build',
12
+ group => $group,
13
+ home => $home,
14
+ root => $root
15
+ }
16
+ }
@@ -0,0 +1,40 @@
1
+ define rbenv::plugin(
2
+ $user,
3
+ $source,
4
+ $plugin_name = $title,
5
+ $group = $user,
6
+ $home = '',
7
+ $root = '',
8
+ $timeout = 100
9
+ ) {
10
+
11
+ $home_path = $home ? { '' => "/home/${user}", default => $home }
12
+ $root_path = $root ? { '' => "${home_path}/.rbenv", default => $root }
13
+ $plugins = "${root_path}/plugins"
14
+ $destination = "${plugins}/${plugin_name}"
15
+
16
+ if $source !~ /^git:/ {
17
+ fail('Only git plugins are supported')
18
+ }
19
+
20
+ if ! defined(File["rbenv::plugins ${user}"]) {
21
+ file { "rbenv::plugins ${user}":
22
+ ensure => directory,
23
+ path => $plugins,
24
+ owner => $user,
25
+ group => $group,
26
+ require => Exec["rbenv::checkout ${user}"],
27
+ }
28
+ }
29
+
30
+ exec { "rbenv::plugin::checkout ${user} ${plugin_name}":
31
+ command => "git clone ${source} ${destination}",
32
+ user => $user,
33
+ group => $group,
34
+ creates => $destination,
35
+ path => ['/usr/bin', '/usr/sbin'],
36
+ timeout => $timeout,
37
+ cwd => $home_path,
38
+ require => File["rbenv::plugins ${user}"],
39
+ }
40
+ }
@@ -0,0 +1,109 @@
1
+ {
2
+ "name": "alup-rbenv",
3
+ "version": "1.2.0",
4
+ "source": "UNKNOWN",
5
+ "author": "alup",
6
+ "license": "MIT",
7
+ "summary": "rbenv Ruby Version Manager module",
8
+ "description": "Puppet module for rbenv Ruby Version Manager",
9
+ "project_page": "https://github.com/alup/puppet-rbenv",
10
+ "dependencies": [
11
+
12
+ ],
13
+ "types": [
14
+ {
15
+ "name": "rbenvgem",
16
+ "doc": "A Ruby Gem installed inside an rbenv-installed Ruby",
17
+ "properties": [
18
+ {
19
+ "name": "ensure",
20
+ "doc": " Valid values are `present` (also called `installed`), `absent`, `latest`. Values can match `/./`."
21
+ }
22
+ ],
23
+ "parameters": [
24
+ {
25
+ "name": "name",
26
+ "doc": "Gem qualified name within an rbenv repository"
27
+ },
28
+ {
29
+ "name": "gemname",
30
+ "doc": "The Gem name"
31
+ },
32
+ {
33
+ "name": "ruby",
34
+ "doc": "The ruby interpreter version"
35
+ },
36
+ {
37
+ "name": "rbenv",
38
+ "doc": "The rbenv root"
39
+ },
40
+ {
41
+ "name": "user",
42
+ "doc": "The rbenv owner"
43
+ }
44
+ ],
45
+ "providers": [
46
+ {
47
+ "name": "default",
48
+ "doc": "Maintains gems inside an RBenv setup\n\nRequired binaries: `su`."
49
+ }
50
+ ]
51
+ }
52
+ ],
53
+ "checksums": {
54
+ "AUTHORS": "41bce6ef435e4c4fb01a3c7662477d58",
55
+ "CHANGELOG.md": "d075b1f284329fff6d5175dbb3278cbc",
56
+ "Gemfile": "f68769c7bd5266f1a4de0607fd78d17a",
57
+ "Gemfile.lock": "571d1b5c4b633773b97a88c8a2974581",
58
+ "Modulefile": "3bb3b412457d726bb0a7318ac4562fa4",
59
+ "README.md": "09fcaeb15a0ad5096f1c6f1ff6e999fb",
60
+ "Rakefile": "7bb6178549213331858bf2512a4f6a17",
61
+ "TODO": "829d2a329bf2974b9d8af868cf35db94",
62
+ "bin/autospec": "d4fde3f4a9f1e5fd339228026654cb70",
63
+ "bin/facter": "54901e1d789da4ff3303d45a6d66fc03",
64
+ "bin/filebucket": "770eee5e0fb7f1013abce8041bc9d407",
65
+ "bin/hiera": "60a41938163cc8af0b56456abcbdfcd3",
66
+ "bin/htmldiff": "8d551a540666732a11d6caa9aa3a0e68",
67
+ "bin/ldiff": "3104dda81ce6a8c0bf122df6ac851365",
68
+ "bin/pi": "b72c410b2de13e2f58526a53cdd8c6b2",
69
+ "bin/puppet": "5349ed70b05332a13b83ba8077dd0043",
70
+ "bin/puppet-lint": "7f9089954f23d779e8ce05a4a53cf440",
71
+ "bin/puppet-module": "5598cb513ff52a621e80d124010ddccb",
72
+ "bin/puppetca": "bc1f6643a1f5752c10f9cd1d967f6339",
73
+ "bin/puppetd": "90205a5cf917d78fd2be85a565b7fbc5",
74
+ "bin/puppetdoc": "93170c3ea411bce6d11d8d6fc96bdf49",
75
+ "bin/puppetmasterd": "dd139c09d5e3f04c103f4ba80221432d",
76
+ "bin/puppetqd": "f3e6ac649b6e2b9f637dee3c7e6c8c1e",
77
+ "bin/puppetrun": "de8fea72006efd65a4efd0c092e6dd39",
78
+ "bin/rake": "d09495e1a29ed0015941718d92deb28b",
79
+ "bin/ralsh": "ac7d134c175adfdd682f5b73b157e81e",
80
+ "bin/rspec": "00ed29f02ccbfaf09483109846c4a9c3",
81
+ "bin/rspec-puppet-init": "6cd42b0ad1382d8a870c1f75caf67a50",
82
+ "lib/puppet/provider/rbenvgem/default.rb": "e4f6ccda50b6b34aa1cacbb565082fa0",
83
+ "lib/puppet/type/rbenvgem.rb": "a3d2f7f9e4ce273d2d58ac86a59377c5",
84
+ "manifests/bundle.pp": "352b95944faacc82cfb15ef3e8eadd36",
85
+ "manifests/client.pp": "c6be48e076e539dfb67f64fa20dc26d6",
86
+ "manifests/compile.pp": "050f1bedccea7e4bf060baa002bf9e93",
87
+ "manifests/definition.pp": "1cfd81042f40aaf34dbb32936c2a3a3a",
88
+ "manifests/dependencies/centos.pp": "71057409e9760e3d53ad7f2a9d862874",
89
+ "manifests/dependencies/suse.pp": "fe7e6bffa09f1bc30f21f77e9c911ada",
90
+ "manifests/dependencies/ubuntu.pp": "803d58aabe0f752e5e1182b15f1991fe",
91
+ "manifests/dependencies.pp": "3a23ca0524928ae39396c451d938319e",
92
+ "manifests/gem.pp": "d4614ec9f988e707ad7b852169cb9e20",
93
+ "manifests/install.pp": "93f1a0ff0cb1b2845567871299161d79",
94
+ "manifests/plugin/rbenvvars.pp": "e9f977b7d5f4c1af85f65b60e04bf145",
95
+ "manifests/plugin/rubybuild.pp": "d8f5df37e2e4f0dbd83145f7cdabf79f",
96
+ "manifests/plugin.pp": "cd89bbf44c3418fefb26a49117957617",
97
+ "spec/classes/dependencies_spec.rb": "6f39406d29bb15e4e2b9155ae09f0daf",
98
+ "spec/defines/rbenv__compile_spec.rb": "b9e07a69c8cd7acbd887fdfba870ddd8",
99
+ "spec/defines/rbenv__definition_spec.rb": "a94134d4a5be5f021ae53489398f74a3",
100
+ "spec/defines/rbenv__install_spec.rb": "044888bc54fc109eb0c22619bca86ffb",
101
+ "spec/defines/rbenv__plugin__rbenvvars_spec.rb": "781cdf9a2a0e0f466636d981d19034b0",
102
+ "spec/defines/rbenv__plugin__rubybuild_spec.rb": "24132e11ad1558227175280ee8fda08f",
103
+ "spec/defines/rbenv__plugin_spec.rb": "0b172008a61009ceac28625f4788ff4b",
104
+ "spec/fixtures/manifests/site.pp": "d41d8cd98f00b204e9800998ecf8427e",
105
+ "spec/spec_helper.rb": "d5f3f46cba1721d2ad62fe96aad002c6",
106
+ "templates/Gemfile.erb": "c1b501d75ff589a4d2f54c1fc2674283",
107
+ "templates/dot.rbenvrc.erb": "dc88eda08086172606be9e1b4b87d90e"
108
+ }
109
+ }
@@ -0,0 +1,5 @@
1
+ source :rubygems
2
+
3
+ <%- @gems.each do |gem| -%>
4
+ gem '<%= gem %>'
5
+ <% end %>
@@ -0,0 +1,8 @@
1
+ #
2
+ # This is a shell fragment that initializes rbenv, if it
3
+ # has not been inited yet. Managed by puppet - DO NOT EDIT
4
+ #
5
+ if ! echo $PATH | grep -q rbenv; then
6
+ export PATH="<%= @root_path %>/bin:$PATH"
7
+ eval "$(rbenv init -)"
8
+ fi