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,24 @@
1
+ # Class: sudo::configs
2
+ #
3
+ # This class enables support for a full hiera based sudoers configuration.
4
+ # Hiera functionality is auto enabled during the initial sudo module load;
5
+ # this class is not intended to be loaded directly.
6
+ #
7
+ # See the primary sudo module documentation for usage and examples.
8
+ #
9
+ class sudo::configs {
10
+
11
+ # NOTE: hiera_hash does not work as expected in a parameterized class
12
+ # definition; so we call it here.
13
+ #
14
+ # http://docs.puppetlabs.com/hiera/1/puppet.html#limitations
15
+ # https://tickets.puppetlabs.com/browse/HI-118
16
+ #
17
+ $configs = hiera_hash('sudo::configs', undef)
18
+
19
+ if $configs {
20
+ create_resources('::sudo::conf', $configs)
21
+ }
22
+
23
+ }
24
+
@@ -0,0 +1,151 @@
1
+ # Class: sudo
2
+ #
3
+ # This module manages sudo
4
+ #
5
+ # Parameters:
6
+ # [*ensure*]
7
+ # Ensure if present or absent.
8
+ # Default: present
9
+ #
10
+ # [*package*]
11
+ # Name of the package.
12
+ # Only set this, if your platform is not supported or you know,
13
+ # what you're doing.
14
+ # Default: auto-set, platform specific
15
+ #
16
+ # [*package_ensure*]
17
+ # Allows you to ensure a particular version of a package
18
+ # Default: present
19
+ #
20
+ # [*package_source*]
21
+ # Where to find the package. Only set this on AIX (required) and
22
+ # Solaris (required) or if your platform is not supported or you
23
+ # know, what you're doing.
24
+ #
25
+ # The default for aix is the perzl sudo package. For solaris 10 we
26
+ # use the official www.sudo.ws binary package.
27
+ #
28
+ # Default: AIX: perzl.org
29
+ # Solaris: www.sudo.ws
30
+ #
31
+ # [*package_admin_file*]
32
+ # Where to find a Solaris 10 package admin file for
33
+ # an unattended installation. We do not supply a default file, so
34
+ # this has to be staged separately
35
+ #
36
+ # Only set this on Solaris 10 (required)
37
+ # Default: /var/sadm/install/admin/puppet
38
+ #
39
+ # [*purge*]
40
+ # Whether or not to purge sudoers.d directory
41
+ # Default: true
42
+ #
43
+ # [*config_file*]
44
+ # Main configuration file.
45
+ # Only set this, if your platform is not supported or you know,
46
+ # what you're doing.
47
+ # Default: auto-set, platform specific
48
+ #
49
+ # [*config_file_replace*]
50
+ # Replace configuration file with that one delivered with this module
51
+ # Default: true
52
+ #
53
+ # [*config_dir*]
54
+ # Main configuration directory
55
+ # Only set this, if your platform is not supported or you know,
56
+ # what you're doing.
57
+ # Default: auto-set, platform specific
58
+ #
59
+ # [*source*]
60
+ # Alternate source file location
61
+ # Only set this, if your platform is not supported or you know,
62
+ # what you're doing.
63
+ # Default: auto-set, platform specific
64
+ #
65
+ # Actions:
66
+ # Installs sudo package and checks the state of sudoers file and sudoers.d directory.
67
+ #
68
+ # Requires:
69
+ # Nothing
70
+ #
71
+ # Sample Usage:
72
+ # class { 'sudo': }
73
+ #
74
+ # [Remember: No empty lines between comments and class definition]
75
+ class sudo(
76
+ $enable = true,
77
+ $package = $sudo::params::package,
78
+ $package_ensure = present,
79
+ $package_source = $sudo::params::package_source,
80
+ $package_admin_file = $sudo::params::package_admin_file,
81
+ $purge = true,
82
+ $config_file = $sudo::params::config_file,
83
+ $config_file_replace = true,
84
+ $config_dir = $sudo::params::config_dir,
85
+ $source = $sudo::params::source
86
+ ) inherits sudo::params {
87
+
88
+
89
+ validate_bool($enable)
90
+ case $enable {
91
+ true: {
92
+ $dir_ensure = 'directory'
93
+ $file_ensure = 'present'
94
+ }
95
+ false: {
96
+ $dir_ensure = 'absent'
97
+ $file_ensure = 'absent'
98
+ }
99
+ }
100
+
101
+ class { 'sudo::package':
102
+ package => $package,
103
+ package_ensure => $package_ensure,
104
+ package_source => $package_source,
105
+ package_admin_file => $package_admin_file,
106
+ }
107
+
108
+ file { $config_file:
109
+ ensure => $file_ensure,
110
+ owner => 'root',
111
+ group => $sudo::params::config_file_group,
112
+ mode => '0440',
113
+ replace => $config_file_replace,
114
+ source => $source,
115
+ require => Package[$package],
116
+ }
117
+
118
+ file { $config_dir:
119
+ ensure => $dir_ensure,
120
+ owner => 'root',
121
+ group => $sudo::params::config_file_group,
122
+ mode => '0550',
123
+ recurse => $purge,
124
+ purge => $purge,
125
+ require => Package[$package],
126
+ }
127
+
128
+ if $config_file_replace == false and $::osfamily == 'RedHat' and $::operatingsystemmajrelease == '5' {
129
+ augeas { 'includedirsudoers':
130
+ changes => ['set /files/etc/sudoers/#includedir /etc/sudoers.d'],
131
+ incl => "$config_file",
132
+ lens => 'FixedSudoers.lns',
133
+ }
134
+ }
135
+
136
+ # Load the Hiera based sudoer configuration (if enabled and present)
137
+ #
138
+ # NOTE: We must use 'include' here to avoid circular dependencies with
139
+ # sudo::conf
140
+ #
141
+ # NOTE: There is no way to detect the existence of hiera. This automatic
142
+ # functionality is therefore made exclusive to Puppet 3+ (hiera is embedded)
143
+ # in order to preserve backwards compatibility.
144
+ #
145
+ # http://projects.puppetlabs.com/issues/12345
146
+ #
147
+ if (versioncmp($::puppetversion, '3') != -1) {
148
+ include 'sudo::configs'
149
+ }
150
+
151
+ }
@@ -0,0 +1,46 @@
1
+ # == Class: sudo::package::aix
2
+ #
3
+ # Install the perzl.org sudo package. It also requires the openldap
4
+ # rpm. so we add a dependencies to the ldap module.
5
+ #
6
+ # === Parameters
7
+ #
8
+ # Document parameters here.
9
+ #
10
+ # [*package*]
11
+ # The name of the sudo package to be installed
12
+ #
13
+ # [*package_ensure*]
14
+ # Ensure if present or absent
15
+ #
16
+ # [*package_source*]
17
+ # Where to find the sudo packge, should be a local file or a uri
18
+ #
19
+ # === Examples
20
+ #
21
+ # class { sudo::package::aix:
22
+ # package => 'sudo',
23
+ # package_source 'http://myaixpkgserver/pkgs/aix/sudo-1.8.6p7-1.aix5.1.ppc.rpm'',
24
+ # }
25
+ #
26
+ # === Authors
27
+ #
28
+ # Toni Schmidbauer <toni@stderr.at>
29
+ #
30
+ # === Copyright
31
+ #
32
+ # Copyright 2013 Toni Schmidbauer
33
+ #
34
+ class sudo::package::aix (
35
+ $package,
36
+ $package_source,
37
+ $package_ensure = 'present',
38
+
39
+ ) {
40
+
41
+ package { $package:
42
+ ensure => $package_ensure,
43
+ source => $package_source,
44
+ provider => rpm,
45
+ }
46
+ }
@@ -0,0 +1,60 @@
1
+ # == Class: sudo::package::solaris
2
+ #
3
+ # install sudo under solaris 10/11.
4
+ #
5
+ # === Parameters
6
+ #
7
+ # Document parameters here.
8
+ #
9
+ # [*package*]
10
+ # The name of the sudo package to be installed
11
+ #
12
+ # [*package_ensure*]
13
+ # Ensure if present or absent
14
+ #
15
+ # [*package_source*]
16
+ # Where to find the sudo packge, should be a local file or a uri
17
+ #
18
+ # [*package_admin_file*]
19
+ # Solaris 10 package admin file for unattended installation
20
+ #
21
+ # === Examples
22
+ #
23
+ # class { sudo::package::solaris:
24
+ # package => 'sudo',
25
+ # }
26
+ #
27
+ # === Authors
28
+ #
29
+ # Toni Schmidbauer <toni@stderr.at>
30
+ #
31
+ # === Copyright
32
+ #
33
+ # Copyright 2013 Toni Schmidbauer
34
+ #
35
+ class sudo::package::solaris (
36
+ $package,
37
+ $package_source = '',
38
+ $package_ensure = 'present',
39
+ $package_admin_file = '',
40
+ ) {
41
+
42
+ case $::kernelrelease {
43
+ '5.11': {
44
+ package { $package:
45
+ ensure => $package_ensure,
46
+ }
47
+ }
48
+ '5.10': {
49
+ package { $package:
50
+ ensure => $package_ensure,
51
+ source => $package_source,
52
+ adminfile => $package_admin_file,
53
+ install_options => ['-G', ],
54
+ }
55
+ }
56
+ default: {
57
+ fail("Unsupported Solaris kernelrelease ${::kernelrelease}!")
58
+ }
59
+ }
60
+ }
@@ -0,0 +1,61 @@
1
+ # == Class: sudo::package
2
+ #
3
+ # Installs the sudo package on various platforms.
4
+ #
5
+ # === Parameters
6
+ #
7
+ # Document parameters here.
8
+ #
9
+ # [*package*]
10
+ # The name of the sudo package to be installed
11
+ #
12
+ # [*package_ensure*]
13
+ # Ensure if present or absent
14
+ #
15
+ # [*package_source*]
16
+ # Where to find the sudo packge, should be a local file or a uri
17
+ #
18
+ # === Examples
19
+ #
20
+ # class { sysdoc::package
21
+ # package => 'sudo',
22
+ # }
23
+ #
24
+ # === Authors
25
+ #
26
+ # Toni Schmidbauer <toni@stderr.at>
27
+ #
28
+ # === Copyright
29
+ #
30
+ # Copyright 2013 Toni Schmidbauer
31
+ #
32
+ class sudo::package(
33
+ $package,
34
+ $package_ensure = present,
35
+ $package_source = '',
36
+ $package_admin_file = '',
37
+ ) {
38
+
39
+ case $::osfamily {
40
+ aix: {
41
+ class { 'sudo::package::aix':
42
+ package => $package,
43
+ package_source => $package_source,
44
+ package_ensure => $package_ensure,
45
+ }
46
+ }
47
+ solaris: {
48
+ class { 'sudo::package::solaris':
49
+ package => $package,
50
+ package_source => $package_source,
51
+ package_ensure => $package_ensure,
52
+ package_admin_file => $package_admin_file,
53
+ }
54
+ }
55
+ default: {
56
+ package { $package:
57
+ ensure => $package_ensure,
58
+ }
59
+ }
60
+ }
61
+ }
@@ -0,0 +1,127 @@
1
+ class sudo::params {
2
+ $source_base = "puppet:///modules/${module_name}/"
3
+
4
+ case $::osfamily {
5
+ debian: {
6
+ case $::operatingsystem {
7
+ 'Ubuntu': {
8
+ $source = "${source_base}sudoers.ubuntu"
9
+ }
10
+ default: {
11
+
12
+ case $::lsbdistcodename {
13
+ 'wheezy': {
14
+ $source = "${source_base}sudoers.wheezy"
15
+ }
16
+ default: {
17
+ $source = "${source_base}sudoers.deb"
18
+ }
19
+ }
20
+ }
21
+ }
22
+ $package = 'sudo'
23
+ $config_file = '/etc/sudoers'
24
+ $config_dir = '/etc/sudoers.d/'
25
+ $config_file_group = 'root'
26
+ }
27
+ redhat: {
28
+ $package = 'sudo'
29
+ $config_file = '/etc/sudoers'
30
+ $config_dir = '/etc/sudoers.d/'
31
+ $source = $::operatingsystemrelease ? {
32
+ /^5/ => "${source_base}sudoers.rhel5",
33
+ /^6/ => "${source_base}sudoers.rhel6",
34
+ default => "${source_base}sudoers.rhel6",
35
+ }
36
+ $config_file_group = 'root'
37
+ }
38
+ suse: {
39
+ $package = 'sudo'
40
+ $config_file = '/etc/sudoers'
41
+ $config_dir = '/etc/sudoers.d/'
42
+ $source = "${source_base}sudoers.suse"
43
+ $config_file_group = 'root'
44
+ }
45
+ solaris: {
46
+ case $::operatingsystem {
47
+ 'OmniOS': {
48
+ $package = 'sudo'
49
+ $config_file = '/etc/sudoers'
50
+ $config_dir = '/etc/sudoers.d/'
51
+ $source = "${source_base}sudoers.omnios"
52
+ $config_file_group = 'root'
53
+ }
54
+ default: {
55
+ case $::kernelrelease {
56
+ '5.11': {
57
+ $package = 'pkg://solaris/security/sudo'
58
+ $config_file = '/etc/sudoers'
59
+ $config_dir = '/etc/sudoers.d/'
60
+ $source = "${source_base}sudoers.solaris"
61
+ $config_file_group = 'root'
62
+ }
63
+ '5.10': {
64
+ $package = 'TCMsudo'
65
+ $package_source = 'http://www.sudo.ws/sudo/dist/packages/Solaris/10/TCMsudo-1.8.9p5-i386.pkg.gz'
66
+ $package_admin_file = '/var/sadm/install/admin/puppet'
67
+ $config_file = '/etc/sudoers'
68
+ $config_dir = '/etc/sudoers.d/'
69
+ $source = "${source_base}sudoers.solaris"
70
+ $config_file_group = 'root'
71
+ }
72
+ default: {
73
+ fail("Unsupported platform: ${::osfamily}/${::operatingsystem}/${::kernelrelease}")
74
+ }
75
+ }
76
+ }
77
+ }
78
+ }
79
+ freebsd: {
80
+ $package = 'security/sudo'
81
+ $config_file = '/usr/local/etc/sudoers'
82
+ $config_dir = '/usr/local/etc/sudoers.d/'
83
+ $source = "${source_base}sudoers.freebsd"
84
+ $config_file_group = 'wheel'
85
+ }
86
+ aix: {
87
+ $package = 'sudo'
88
+ $package_source = 'http://www.sudo.ws/sudo/dist/packages/AIX/5.3/sudo-1.8.9-6.aix53.lam.rpm'
89
+ $config_file = '/etc/sudoers'
90
+ $config_dir = '/etc/sudoers.d/'
91
+ $source = "${source_base}sudoers.aix"
92
+ $config_file_group = 'system'
93
+ }
94
+ default: {
95
+ case $::operatingsystem {
96
+ gentoo: {
97
+ $package = 'sudo'
98
+ $config_file = '/etc/sudoers'
99
+ $config_dir = '/etc/sudoers.d/'
100
+ $source = "${source_base}sudoers.deb"
101
+ $config_file_group = 'root'
102
+ }
103
+ archlinux: {
104
+ $package = 'sudo'
105
+ $config_file = '/etc/sudoers'
106
+ $config_dir = '/etc/sudoers.d/'
107
+ $source = "${source_base}sudoers.archlinux"
108
+ $config_file_group = 'root'
109
+ }
110
+ amazon: {
111
+ $package = 'sudo'
112
+ $config_file = '/etc/sudoers'
113
+ $config_dir = '/etc/sudoers.d/'
114
+ $source = $::operatingsystemrelease ? {
115
+ /^5/ => "${source_base}sudoers.rhel5",
116
+ /^6/ => "${source_base}sudoers.rhel6",
117
+ default => "${source_base}sudoers.rhel6",
118
+ }
119
+ $config_file_group = 'root'
120
+ }
121
+ default: {
122
+ fail("Unsupported platform: ${::osfamily}/${::operatingsystem}")
123
+ }
124
+ }
125
+ }
126
+ }
127
+ }
@@ -0,0 +1,59 @@
1
+ {
2
+ "author": "saz",
3
+ "checksums": {
4
+ "manifests/package.pp": "75b527364251a68c95b9958bc46f2de4",
5
+ "lib/augeas/lenses/fixedsudoers.aug": "1492fda700091a906d27195bcdc40c90",
6
+ "spec/classes/package_aix_spec.rb": "bec2e7879dba5977f2a470b230c11750",
7
+ ".gemfile": "14bd1a18be3e43568e7825c12a3dc0aa",
8
+ "manifests/configs.pp": "c6e29a9a2490d00a9aacadbbd887e38d",
9
+ ".travis.yml": "2fbb8aedfde8603aca1a9617bf450f13",
10
+ "spec/spec.opts": "a600ded995d948e393fbe2320ba8e51c",
11
+ "spec/spec_helper.rb": "0db89c9a486df193c0e40095422e19dc",
12
+ "LICENSE": "c43ad7837d4770c3823fdab29a78f0e3",
13
+ "manifests/params.pp": "e290e3610dc6b9e02cf0d3c4b7750a3a",
14
+ "files/sudoers.deb": "ebd77e09715c4da6be84d56233139fff",
15
+ "manifests/allow.pp": "888e9ed1f5e4c6ec4d7309b7dc390296",
16
+ "files/sudoers.rhel5": "68ba7e0c1d117579112e5ef95464aac5",
17
+ "spec/classes/sudo_spec.rb": "eadd5d58f918783ca0c15d0ff4c3e3a3",
18
+ "files/sudoers.rhel6": "4093e52552d97099d003c645f15f9372",
19
+ "manifests/package/aix.pp": "195b5cd05c7921ead3c32674f84b1af7",
20
+ "manifests/init.pp": "b3133b7505c83daad6d613b6a755191f",
21
+ "files/sudoers.omnios": "cd782a48b45d845b34262063e4c8c0b1",
22
+ "files/sudoers.suse": "40468b19c03962cf383caf5ababed6d0",
23
+ "manifests/conf.pp": "25aa49bd86d5884cd8b1ec4b0b905de4",
24
+ "files/sudoers.freebsd": "4e2d60b0bdc7c3d77ceae7fd9224f47f",
25
+ "README.md": "e9e3f573a085c08d2ea116a0fed38e7a",
26
+ "Rakefile": "0254db5d3fc38c67a2c160d7296a24f8",
27
+ ".bundle/config": "7f1c988748783d2a8d455376eed1470c",
28
+ "files/sudoers.aix": "cd782a48b45d845b34262063e4c8c0b1",
29
+ "spec/classes/package_spec.rb": "0f9bbd84bf19cdf08ec8018bf42b8cf2",
30
+ "spec/defines/sudo_spec.rb": "e98a45d7e4c4eee0118f0e54c3c63440",
31
+ "templates/users_groups.erb": "93854eda68a164a05d3c2aed3efbea6e",
32
+ "Modulefile": "aef6a385252d46ca3faadad77354dcad",
33
+ "tests/init.pp": "63f528ee1d1698fadd336da35dd4ec7a",
34
+ "files/sudoers.archlinux": "5256992be7eb0edb09564f08f01e92c6",
35
+ ".fixtures.yml": "5999b8700eec463d58e0d6c1f95141b0",
36
+ "files/sudoers.wheezy": "730c932c78e53458817e742050edb089",
37
+ ".gemfile.lock": "c37e217586bb814998d29338aca60d1b",
38
+ "files/sudoers.ubuntu": "e8e73f16ed73309df7574c12fbcc0af7",
39
+ "manifests/package/solaris.pp": "ff97652fef9bab5157a48ef9b9d87ac8",
40
+ "files/sudoers.solaris": "49aee40059e1427dd59b8b5c25a45ca5"
41
+ },
42
+ "dependencies": [
43
+ {
44
+ "name": "puppetlabs/stdlib",
45
+ "version_requirement": "\u003e\u003d 2.3.0"
46
+ }
47
+ ],
48
+ "description": "Manage sudo configuration via Puppet",
49
+ "license": "Apache License, Version 2.0",
50
+ "name": "saz-sudo",
51
+ "operatingsystem_support": [],
52
+ "project_page": "https://github.com/saz/puppet-sudo",
53
+ "requirements": [],
54
+ "source": "UNKNOWN",
55
+ "summary": "UNKNOWN",
56
+ "tags": [],
57
+ "types": [],
58
+ "version": "3.0.6"
59
+ }
@@ -0,0 +1,9 @@
1
+ # This file is managed by Puppet. All changes will be reverted
2
+ # on the next Puppet run. Avoid making changes here.
3
+ <%# We can prevent excess newlines by using a special "-%" closing tag -%>
4
+ <% @users.each do |user| -%>
5
+ <%= user %> ALL=(ALL) ALL
6
+ <% end -%>
7
+ <% @groups.each do |group| -%>
8
+ %<%= group %> ALL=(ALL) ALL
9
+ <% end -%>
@@ -0,0 +1,15 @@
1
+ class users {
2
+
3
+ $hiera_users = hiera("user_accounts")
4
+ each($hiera_users) |$value| {
5
+ $name = $value[name]
6
+ $email = $value[email]
7
+ $uid = $value[uid]
8
+ $key = $value[key]
9
+ users::user { $name:
10
+ uid => $uid,
11
+ email => $email,
12
+ key => $key,
13
+ }
14
+ }
15
+ }
@@ -0,0 +1,50 @@
1
+
2
+ define users::user($email, $uid, $key) {
3
+ $username = $title
4
+
5
+ $groups = ["root", "sudo"]
6
+
7
+ user { $username:
8
+ ensure => present,
9
+ comment => "${email}",
10
+ home => "/home/${username}",
11
+ shell => "/bin/bash",
12
+ groups => $groups,
13
+ membership => "inclusive",
14
+ uid => $uid,
15
+ managehome => true,
16
+ # Generated from openssl passwd -1 in the server
17
+ # by default 'bebox'
18
+ password => '$1$x3VGbtoD$igWgkE/f.P3QpQjOZcTBz/'
19
+ }
20
+
21
+ group { $username:
22
+ gid => $uid,
23
+ require => User[$username],
24
+ }
25
+
26
+ file { "/home/${username}/":
27
+ ensure => directory,
28
+ owner => $username,
29
+ group => $username,
30
+ mode => 0644,
31
+ require => [ User[$username], Group[$username] ]
32
+ }
33
+
34
+ file { "/home/${username}/.ssh":
35
+ ensure => directory,
36
+ owner => $username,
37
+ group => $username,
38
+ mode => 0600,
39
+ require => File["/home/${username}/"],
40
+ }
41
+
42
+ file { "/home/${username}/.ssh/authorized_keys":
43
+ ensure => present,
44
+ owner => $username,
45
+ group => $username,
46
+ mode => 0600,
47
+ require => File["/home/${username}/.ssh"],
48
+ content => $key,
49
+ }
50
+ }
@@ -0,0 +1,5 @@
1
+ forge "https://forgeapi.puppetlabs.com"
2
+
3
+ <% profile_modules.each do |puppet_module| %>
4
+ <%="#{puppet_module}\n"%>
5
+ <% end %>
@@ -0,0 +1,11 @@
1
+ user_accounts:
2
+ - name: '<%= project_name %>'
3
+ email: ''
4
+ key: '<%= ssh_key %>'
5
+ uid: 7001
6
+ # Add rules to permit ssh forward agent to github repositories
7
+ ssh::client_rules:
8
+ 'Host github.com':
9
+ 'User' : '<%= project_name %>'
10
+ 'ForwardAgent': 'yes'
11
+ 'StrictHostKeyChecking': 'no'
@@ -0,0 +1,11 @@
1
+ user_accounts:
2
+ - name: '<%= project_name %>'
3
+ email: ''
4
+ key: '<%= ssh_key %>'
5
+ uid: 7001
6
+ # Add rules to permit ssh forward agent to github repositories
7
+ ssh::client_rules:
8
+ 'Host github.com':
9
+ 'User' : '<%= project_name %>'
10
+ 'ForwardAgent': 'yes'
11
+ 'StrictHostKeyChecking': 'no'
@@ -0,0 +1,11 @@
1
+ user_accounts:
2
+ - name: '<%= project_name %>'
3
+ email: ''
4
+ key: '<%= ssh_key %>'
5
+ uid: 7001
6
+ # Add rules to permit ssh forward agent to github repositories
7
+ ssh::client_rules:
8
+ 'Host github.com':
9
+ 'User' : '<%= project_name %>'
10
+ 'ForwardAgent': 'yes'
11
+ 'StrictHostKeyChecking': 'no'
@@ -0,0 +1,11 @@
1
+ # Important note: This file is empty.
2
+ # /etc/puppet/hiera.yml is used by default.
3
+ # deploy_user and deploy_environment is set in the puppet apply command executed by capistrano
4
+ :backends: yaml
5
+ :yaml:
6
+ :datadir: %{::deploy_to}/current/steps/<%=step_dir%>/hiera/data
7
+ :hierarchy:
8
+ - %{::fqdn}
9
+ - %{::deploy_environment}
10
+ - common
11
+ :logger: console
@@ -0,0 +1,5 @@
1
+ node <%= node.hostname %> {
2
+
3
+ include roles::users
4
+
5
+ }
@@ -0,0 +1,15 @@
1
+ # This file associates nodes with roles
2
+ # Example:
3
+ # node node0.server1.test {
4
+ # include roles::role_1
5
+ # }
6
+ # The roles and profiles pattern recommends to associate one node with
7
+ # one and only one role.
8
+ # The role can be set to the node manually or through the
9
+ # 'bebox node set_role' command.
10
+
11
+ <% nodes.each do |node| %>
12
+ node <%= node.hostname %> {
13
+ include roles::users
14
+ }
15
+ <% end %>