freighthop 0.2.1 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (322) hide show
  1. data/Puppetfile +4 -3
  2. data/Puppetfile.lock +14 -2
  3. data/Vagrantfile +5 -1
  4. data/data/common.json +4 -3
  5. data/freighthop.gemspec +1 -1
  6. data/lib/freighthop/cli/checks.rb +12 -0
  7. data/lib/freighthop/cli/help.rb +7 -0
  8. data/lib/freighthop/cli/init.rb +35 -0
  9. data/lib/freighthop/cli/ssh.rb +1 -0
  10. data/lib/freighthop/cli/vagrant.rb +1 -0
  11. data/lib/freighthop/cli.rb +5 -17
  12. data/lib/freighthop/config.rb +5 -1
  13. data/lib/freighthop/version.rb +1 -1
  14. data/lib/freighthop.rb +6 -1
  15. data/local_modules/freighthop/manifests/database/mysql/grant.pp +11 -0
  16. data/local_modules/freighthop/manifests/database/mysql.pp +5 -15
  17. data/local_modules/freighthop/manifests/database/postgres.pp +2 -2
  18. data/local_modules/freighthop/manifests/database.pp +3 -3
  19. data/local_modules/freighthop/manifests/init.pp +6 -23
  20. data/local_modules/freighthop/manifests/language/ruby.pp +5 -25
  21. data/local_modules/freighthop/manifests/language.pp +1 -4
  22. data/local_modules/freighthop/manifests/packages.pp +2 -12
  23. data/local_modules/freighthop/manifests/params.pp +19 -11
  24. data/local_modules/freighthop/manifests/web/apache.pp +60 -0
  25. data/local_modules/freighthop/manifests/web/nginx.pp +22 -0
  26. data/local_modules/freighthop/manifests/web/ssl.pp +13 -0
  27. data/local_modules/freighthop/manifests/web.pp +25 -21
  28. data/local_modules/freighthop/templates/apache/passenger.conf.erb +18 -0
  29. data/local_modules/freighthop/templates/nginx/vagrant-rails.conf.erb +5 -3
  30. data/modules/apache/CHANGELOG.md +172 -0
  31. data/modules/apache/CONTRIBUTING.md +234 -0
  32. data/modules/apache/Gemfile +25 -0
  33. data/modules/apache/LICENSE +15 -0
  34. data/modules/apache/Modulefile +12 -0
  35. data/modules/apache/README.md +1515 -0
  36. data/modules/apache/README.passenger.md +93 -0
  37. data/modules/apache/Rakefile +1 -0
  38. data/modules/apache/files/httpd +24 -0
  39. data/modules/apache/lib/puppet/provider/a2mod/a2mod.rb +35 -0
  40. data/modules/apache/lib/puppet/provider/a2mod/gentoo.rb +116 -0
  41. data/modules/apache/lib/puppet/provider/a2mod/modfix.rb +12 -0
  42. data/modules/apache/lib/puppet/provider/a2mod/redhat.rb +60 -0
  43. data/modules/apache/lib/puppet/provider/a2mod.rb +34 -0
  44. data/modules/apache/lib/puppet/type/a2mod.rb +30 -0
  45. data/modules/apache/manifests/balancer.pp +80 -0
  46. data/modules/apache/manifests/balancermember.pp +52 -0
  47. data/modules/apache/manifests/confd/no_accf.pp +10 -0
  48. data/modules/apache/manifests/default_confd_files.pp +12 -0
  49. data/modules/apache/manifests/default_mods/load.pp +8 -0
  50. data/modules/apache/manifests/default_mods.pp +108 -0
  51. data/modules/apache/manifests/dev.pp +11 -0
  52. data/modules/apache/manifests/init.pp +329 -0
  53. data/modules/apache/manifests/listen.pp +9 -0
  54. data/modules/apache/manifests/mod/alias.pp +17 -0
  55. data/modules/apache/manifests/mod/auth_basic.pp +3 -0
  56. data/modules/apache/manifests/mod/auth_kerb.pp +5 -0
  57. data/modules/apache/manifests/mod/authnz_ldap.pp +19 -0
  58. data/modules/apache/manifests/mod/autoindex.pp +12 -0
  59. data/modules/apache/manifests/mod/cache.pp +3 -0
  60. data/modules/apache/manifests/mod/cgi.pp +4 -0
  61. data/modules/apache/manifests/mod/cgid.pp +23 -0
  62. data/modules/apache/manifests/mod/dav.pp +3 -0
  63. data/modules/apache/manifests/mod/dav_fs.pp +20 -0
  64. data/modules/apache/manifests/mod/dav_svn.pp +5 -0
  65. data/modules/apache/manifests/mod/deflate.pp +12 -0
  66. data/modules/apache/manifests/mod/dev.pp +5 -0
  67. data/modules/apache/manifests/mod/dir.pp +21 -0
  68. data/modules/apache/manifests/mod/disk_cache.pp +24 -0
  69. data/modules/apache/manifests/mod/event.pp +54 -0
  70. data/modules/apache/manifests/mod/expires.pp +3 -0
  71. data/modules/apache/manifests/mod/fastcgi.pp +24 -0
  72. data/modules/apache/manifests/mod/fcgid.pp +3 -0
  73. data/modules/apache/manifests/mod/headers.pp +3 -0
  74. data/modules/apache/manifests/mod/include.pp +3 -0
  75. data/modules/apache/manifests/mod/info.pp +14 -0
  76. data/modules/apache/manifests/mod/itk.pp +64 -0
  77. data/modules/apache/manifests/mod/ldap.pp +12 -0
  78. data/modules/apache/manifests/mod/mime.pp +21 -0
  79. data/modules/apache/manifests/mod/mime_magic.pp +14 -0
  80. data/modules/apache/manifests/mod/negotiation.pp +12 -0
  81. data/modules/apache/manifests/mod/nss.pp +25 -0
  82. data/modules/apache/manifests/mod/passenger.pp +38 -0
  83. data/modules/apache/manifests/mod/perl.pp +3 -0
  84. data/modules/apache/manifests/mod/peruser.pp +73 -0
  85. data/modules/apache/manifests/mod/php.pp +26 -0
  86. data/modules/apache/manifests/mod/prefork.pp +74 -0
  87. data/modules/apache/manifests/mod/proxy.pp +15 -0
  88. data/modules/apache/manifests/mod/proxy_ajp.pp +4 -0
  89. data/modules/apache/manifests/mod/proxy_balancer.pp +10 -0
  90. data/modules/apache/manifests/mod/proxy_html.pp +28 -0
  91. data/modules/apache/manifests/mod/proxy_http.pp +4 -0
  92. data/modules/apache/manifests/mod/python.pp +5 -0
  93. data/modules/apache/manifests/mod/reqtimeout.pp +12 -0
  94. data/modules/apache/manifests/mod/rewrite.pp +4 -0
  95. data/modules/apache/manifests/mod/rpaf.pp +20 -0
  96. data/modules/apache/manifests/mod/setenvif.pp +12 -0
  97. data/modules/apache/manifests/mod/ssl.pp +26 -0
  98. data/modules/apache/manifests/mod/status.pp +42 -0
  99. data/modules/apache/manifests/mod/suphp.pp +14 -0
  100. data/modules/apache/manifests/mod/userdir.pp +17 -0
  101. data/modules/apache/manifests/mod/vhost_alias.pp +3 -0
  102. data/modules/apache/manifests/mod/worker.pp +75 -0
  103. data/modules/apache/manifests/mod/wsgi.pp +21 -0
  104. data/modules/apache/manifests/mod/xsendfile.pp +4 -0
  105. data/modules/apache/manifests/mod.pp +120 -0
  106. data/modules/apache/manifests/namevirtualhost.pp +9 -0
  107. data/modules/apache/manifests/package.pp +48 -0
  108. data/modules/apache/manifests/params.pp +207 -0
  109. data/modules/apache/manifests/peruser/multiplexer.pp +17 -0
  110. data/modules/apache/manifests/peruser/processor.pp +17 -0
  111. data/modules/apache/manifests/php.pp +18 -0
  112. data/modules/apache/manifests/proxy.pp +15 -0
  113. data/modules/apache/manifests/python.pp +18 -0
  114. data/modules/apache/manifests/service.pp +35 -0
  115. data/modules/apache/manifests/ssl.pp +18 -0
  116. data/modules/apache/manifests/vhost.pp +516 -0
  117. data/modules/apache/spec/acceptance/basic_spec.rb +12 -0
  118. data/modules/apache/spec/acceptance/class_spec.rb +58 -0
  119. data/modules/apache/spec/acceptance/default_mods_spec.rb +97 -0
  120. data/modules/apache/spec/acceptance/itk_spec.rb +35 -0
  121. data/modules/apache/spec/acceptance/mod_php_spec.rb +52 -0
  122. data/modules/apache/spec/acceptance/mod_suphp_spec.rb +44 -0
  123. data/modules/apache/spec/acceptance/nodesets/centos-64-x64.yml +8 -0
  124. data/modules/apache/spec/acceptance/nodesets/default.yml +8 -0
  125. data/modules/apache/spec/acceptance/nodesets/ubuntu-server-12042-x64.yml +8 -0
  126. data/modules/apache/spec/acceptance/nodesets/vagrant.key +27 -0
  127. data/modules/apache/spec/acceptance/prefork_worker_spec.rb +81 -0
  128. data/modules/apache/spec/acceptance/service_spec.rb +19 -0
  129. data/modules/apache/spec/acceptance/vhost_spec.rb +290 -0
  130. data/modules/apache/spec/classes/apache_spec.rb +464 -0
  131. data/modules/apache/spec/classes/dev_spec.rb +38 -0
  132. data/modules/apache/spec/classes/mod/auth_kerb_spec.rb +41 -0
  133. data/modules/apache/spec/classes/mod/authnz_ldap_spec.rb +65 -0
  134. data/modules/apache/spec/classes/mod/dav_svn_spec.rb +41 -0
  135. data/modules/apache/spec/classes/mod/dev_spec.rb +23 -0
  136. data/modules/apache/spec/classes/mod/dir_spec.rb +88 -0
  137. data/modules/apache/spec/classes/mod/event_spec.rb +17 -0
  138. data/modules/apache/spec/classes/mod/fastcgi_spec.rb +32 -0
  139. data/modules/apache/spec/classes/mod/fcgid_spec.rb +41 -0
  140. data/modules/apache/spec/classes/mod/info_spec.rb +99 -0
  141. data/modules/apache/spec/classes/mod/itk_spec.rb +31 -0
  142. data/modules/apache/spec/classes/mod/mime_magic_spec.rb +93 -0
  143. data/modules/apache/spec/classes/mod/passenger_spec.rb +112 -0
  144. data/modules/apache/spec/classes/mod/perl_spec.rb +41 -0
  145. data/modules/apache/spec/classes/mod/peruser_spec.rb +17 -0
  146. data/modules/apache/spec/classes/mod/php_spec.rb +99 -0
  147. data/modules/apache/spec/classes/mod/prefork_spec.rb +47 -0
  148. data/modules/apache/spec/classes/mod/proxy_html_spec.rb +45 -0
  149. data/modules/apache/spec/classes/mod/python_spec.rb +41 -0
  150. data/modules/apache/spec/classes/mod/rpaf_spec.rb +77 -0
  151. data/modules/apache/spec/classes/mod/ssl_spec.rb +53 -0
  152. data/modules/apache/spec/classes/mod/status_spec.rb +166 -0
  153. data/modules/apache/spec/classes/mod/suphp_spec.rb +27 -0
  154. data/modules/apache/spec/classes/mod/worker_spec.rb +44 -0
  155. data/modules/apache/spec/classes/mod/wsgi_spec.rb +54 -0
  156. data/modules/apache/spec/classes/params_spec.rb +21 -0
  157. data/modules/apache/spec/classes/service_spec.rb +109 -0
  158. data/modules/apache/spec/defines/mod_spec.rb +105 -0
  159. data/modules/apache/spec/defines/vhost_spec.rb +1152 -0
  160. data/modules/apache/spec/fixtures/modules/site_apache/templates/fake.conf.erb +1 -0
  161. data/modules/apache/spec/spec.opts +4 -0
  162. data/modules/apache/spec/spec_helper.rb +1 -0
  163. data/modules/apache/spec/spec_helper_acceptance.rb +27 -0
  164. data/modules/apache/spec/unit/provider/a2mod/gentoo_spec.rb +184 -0
  165. data/modules/apache/templates/confd/no-accf.conf.erb +4 -0
  166. data/modules/apache/templates/httpd.conf.erb +92 -0
  167. data/modules/apache/templates/listen.erb +6 -0
  168. data/modules/apache/templates/mod/alias.conf.erb +9 -0
  169. data/modules/apache/templates/mod/authnz_ldap.conf.erb +5 -0
  170. data/modules/apache/templates/mod/autoindex.conf.erb +56 -0
  171. data/modules/apache/templates/mod/cgid.conf.erb +1 -0
  172. data/modules/apache/templates/mod/dav_fs.conf.erb +1 -0
  173. data/modules/apache/templates/mod/deflate.conf.erb +4 -0
  174. data/modules/apache/templates/mod/dir.conf.erb +1 -0
  175. data/modules/apache/templates/mod/disk_cache.conf.erb +8 -0
  176. data/modules/apache/templates/mod/event.conf.erb +9 -0
  177. data/modules/apache/templates/mod/fastcgi.conf.erb +6 -0
  178. data/modules/apache/templates/mod/info.conf.erb +6 -0
  179. data/modules/apache/templates/mod/itk.conf.erb +8 -0
  180. data/modules/apache/templates/mod/ldap.conf.erb +7 -0
  181. data/modules/apache/templates/mod/mime.conf.erb +36 -0
  182. data/modules/apache/templates/mod/mime_magic.conf.erb +1 -0
  183. data/modules/apache/templates/mod/mpm_event.conf.erb +9 -0
  184. data/modules/apache/templates/mod/negotiation.conf.erb +2 -0
  185. data/modules/apache/templates/mod/nss.conf.erb +228 -0
  186. data/modules/apache/templates/mod/passenger.conf.erb +30 -0
  187. data/modules/apache/templates/mod/peruser.conf.erb +12 -0
  188. data/modules/apache/templates/mod/php5.conf.erb +30 -0
  189. data/modules/apache/templates/mod/prefork.conf.erb +8 -0
  190. data/modules/apache/templates/mod/proxy.conf.erb +23 -0
  191. data/modules/apache/templates/mod/proxy_html.conf.erb +24 -0
  192. data/modules/apache/templates/mod/reqtimeout.conf.erb +2 -0
  193. data/modules/apache/templates/mod/rpaf.conf.erb +15 -0
  194. data/modules/apache/templates/mod/setenvif.conf.erb +34 -0
  195. data/modules/apache/templates/mod/ssl.conf.erb +24 -0
  196. data/modules/apache/templates/mod/status.conf.erb +12 -0
  197. data/modules/apache/templates/mod/suphp.conf.erb +19 -0
  198. data/modules/apache/templates/mod/userdir.conf.erb +19 -0
  199. data/modules/apache/templates/mod/worker.conf.erb +9 -0
  200. data/modules/apache/templates/mod/wsgi.conf.erb +13 -0
  201. data/modules/apache/templates/namevirtualhost.erb +8 -0
  202. data/modules/apache/templates/ports_header.erb +5 -0
  203. data/modules/apache/templates/vhost/_aliases.erb +12 -0
  204. data/modules/apache/templates/vhost/_block.erb +10 -0
  205. data/modules/apache/templates/vhost/_custom_fragment.erb +5 -0
  206. data/modules/apache/templates/vhost/_directories.erb +143 -0
  207. data/modules/apache/templates/vhost/_error_document.erb +7 -0
  208. data/modules/apache/templates/vhost/_fastcgi.erb +18 -0
  209. data/modules/apache/templates/vhost/_itk.erb +28 -0
  210. data/modules/apache/templates/vhost/_php_admin.erb +12 -0
  211. data/modules/apache/templates/vhost/_proxy.erb +20 -0
  212. data/modules/apache/templates/vhost/_rack.erb +7 -0
  213. data/modules/apache/templates/vhost/_redirect.erb +12 -0
  214. data/modules/apache/templates/vhost/_requestheader.erb +10 -0
  215. data/modules/apache/templates/vhost/_rewrite.erb +40 -0
  216. data/modules/apache/templates/vhost/_scriptalias.erb +24 -0
  217. data/modules/apache/templates/vhost/_serveralias.erb +7 -0
  218. data/modules/apache/templates/vhost/_setenv.erb +12 -0
  219. data/modules/apache/templates/vhost/_ssl.erb +41 -0
  220. data/modules/apache/templates/vhost/_suphp.erb +11 -0
  221. data/modules/apache/templates/vhost/_wsgi.erb +15 -0
  222. data/modules/apache/templates/vhost.conf.erb +63 -0
  223. data/modules/apache/tests/apache.pp +6 -0
  224. data/modules/apache/tests/dev.pp +1 -0
  225. data/modules/apache/tests/init.pp +1 -0
  226. data/modules/apache/tests/mod_load_params.pp +11 -0
  227. data/modules/apache/tests/mods.pp +9 -0
  228. data/modules/apache/tests/mods_custom.pp +16 -0
  229. data/modules/apache/tests/php.pp +4 -0
  230. data/modules/apache/tests/vhost.pp +237 -0
  231. data/modules/apache/tests/vhost_directories.pp +30 -0
  232. data/modules/apache/tests/vhost_ip_based.pp +25 -0
  233. data/modules/apache/tests/vhost_ssl.pp +23 -0
  234. data/modules/apache/tests/vhosts_without_listen.pp +53 -0
  235. data/modules/freighthop/manifests/database/mysql/grant.pp +11 -0
  236. data/modules/freighthop/manifests/database/mysql.pp +5 -15
  237. data/modules/freighthop/manifests/database/postgres.pp +2 -2
  238. data/modules/freighthop/manifests/database.pp +3 -3
  239. data/modules/freighthop/manifests/init.pp +6 -23
  240. data/modules/freighthop/manifests/language/ruby.pp +5 -25
  241. data/modules/freighthop/manifests/language.pp +1 -4
  242. data/modules/freighthop/manifests/packages.pp +2 -12
  243. data/modules/freighthop/manifests/params.pp +19 -11
  244. data/modules/freighthop/manifests/web/apache.pp +60 -0
  245. data/modules/freighthop/manifests/web/nginx.pp +22 -0
  246. data/modules/freighthop/manifests/web/ssl.pp +13 -0
  247. data/modules/freighthop/manifests/web.pp +25 -21
  248. data/modules/freighthop/templates/apache/passenger.conf.erb +18 -0
  249. data/modules/freighthop/templates/nginx/vagrant-rails.conf.erb +5 -3
  250. data/modules/rbenv/AUTHORS +11 -0
  251. data/modules/rbenv/CHANGELOG.md +70 -0
  252. data/modules/rbenv/Gemfile +5 -10
  253. data/modules/rbenv/Gemfile.lock +16 -58
  254. data/modules/rbenv/Modulefile +7 -7
  255. data/modules/rbenv/README.md +156 -20
  256. data/modules/rbenv/Rakefile +18 -24
  257. data/modules/rbenv/TODO +10 -0
  258. data/modules/rbenv/bin/autospec +16 -0
  259. data/modules/rbenv/bin/facter +16 -0
  260. data/modules/rbenv/bin/filebucket +16 -0
  261. data/modules/rbenv/bin/hiera +16 -0
  262. data/modules/rbenv/bin/htmldiff +16 -0
  263. data/modules/rbenv/bin/ldiff +16 -0
  264. data/modules/rbenv/bin/pi +16 -0
  265. data/modules/rbenv/bin/puppet +16 -0
  266. data/modules/rbenv/bin/puppet-lint +16 -0
  267. data/modules/rbenv/bin/puppet-module +16 -0
  268. data/modules/rbenv/bin/puppetca +16 -0
  269. data/modules/rbenv/bin/puppetd +16 -0
  270. data/modules/rbenv/bin/puppetdoc +16 -0
  271. data/modules/rbenv/bin/puppetmasterd +16 -0
  272. data/modules/rbenv/bin/puppetqd +16 -0
  273. data/modules/rbenv/bin/puppetrun +16 -0
  274. data/modules/rbenv/bin/rake +16 -0
  275. data/modules/rbenv/bin/ralsh +16 -0
  276. data/modules/rbenv/bin/rspec +16 -0
  277. data/modules/rbenv/bin/rspec-puppet-init +16 -0
  278. data/modules/rbenv/lib/puppet/provider/rbenvgem/default.rb +50 -0
  279. data/modules/rbenv/lib/puppet/type/rbenvgem.rb +62 -0
  280. data/modules/rbenv/manifests/bundle.pp +36 -0
  281. data/modules/rbenv/manifests/client.pp +48 -0
  282. data/modules/rbenv/manifests/compile.pp +102 -0
  283. data/modules/rbenv/manifests/definition.pp +31 -0
  284. data/modules/rbenv/manifests/dependencies/centos.pp +25 -0
  285. data/modules/rbenv/manifests/dependencies/suse.pp +28 -0
  286. data/modules/rbenv/manifests/dependencies/ubuntu.pp +17 -0
  287. data/modules/rbenv/manifests/dependencies.pp +8 -0
  288. data/modules/rbenv/manifests/gem.pp +29 -0
  289. data/modules/rbenv/manifests/install.pp +55 -0
  290. data/modules/rbenv/manifests/plugin/rbenvvars.pp +16 -0
  291. data/modules/rbenv/manifests/plugin/rubybuild.pp +16 -0
  292. data/modules/rbenv/manifests/plugin.pp +40 -0
  293. data/modules/rbenv/metadata.json +99 -31
  294. data/modules/rbenv/spec/classes/dependencies_spec.rb +20 -0
  295. data/modules/rbenv/spec/defines/rbenv__compile_spec.rb +34 -0
  296. data/modules/rbenv/spec/defines/rbenv__definition_spec.rb +40 -0
  297. data/modules/rbenv/spec/defines/rbenv__install_spec.rb +24 -0
  298. data/modules/rbenv/spec/defines/rbenv__plugin__rbenvvars_spec.rb +14 -0
  299. data/modules/rbenv/spec/defines/rbenv__plugin__rubybuild_spec.rb +14 -0
  300. data/modules/rbenv/spec/defines/rbenv__plugin_spec.rb +31 -0
  301. data/modules/rbenv/spec/fixtures/manifests/site.pp +0 -0
  302. data/modules/rbenv/spec/spec_helper.rb +6 -1
  303. data/modules/rbenv/templates/Gemfile.erb +5 -0
  304. data/modules/rbenv/templates/dot.rbenvrc.erb +8 -0
  305. metadata +271 -23
  306. data/modules/rbenv/CHANGELOG +0 -33
  307. data/modules/rbenv/LICENSE +0 -20
  308. data/modules/rbenv/manifests/alias.pp +0 -32
  309. data/modules/rbenv/manifests/global.pp +0 -22
  310. data/modules/rbenv/manifests/init.pp +0 -30
  311. data/modules/rbenv/manifests/params.pp +0 -16
  312. data/modules/rbenv/manifests/rehash.pp +0 -28
  313. data/modules/rbenv/manifests/version.pp +0 -63
  314. data/modules/rbenv/spec/classes/rbenv__global_spec.rb +0 -31
  315. data/modules/rbenv/spec/classes/rbenv_spec.rb +0 -30
  316. data/modules/rbenv/spec/defines/rbenv__alias_spec.rb +0 -22
  317. data/modules/rbenv/spec/defines/rbenv__rehash_spec.rb +0 -22
  318. data/modules/rbenv/spec/defines/rbenv__version_spec.rb +0 -60
  319. data/modules/rbenv/spec/spec_helper_system.rb +0 -16
  320. data/modules/rbenv/spec/system/basic_spec.rb +0 -13
  321. data/modules/rbenv/templates/etc/profile.d/rbenv.sh.erb +0 -2
  322. data/modules/rbenv/tests/init.pp +0 -12
data/Puppetfile CHANGED
@@ -2,8 +2,9 @@ forge 'http://forge.puppetlabs.com'
2
2
 
3
3
  mod 'puppetlabs/stdlib', '4.1.0'
4
4
  mod 'puppetlabs/apt'
5
- mod 'gdsoperations/rbenv'
6
- mod 'nginx', :git => 'https://github.com/jfryman/puppet-nginx'
5
+ mod 'alup/rbenv'
6
+ mod 'nginx', git: 'https://github.com/jfryman/puppet-nginx'
7
7
  mod 'puppetlabs/postgresql'
8
8
  mod 'puppetlabs/mysql'
9
- mod 'freighthop', :path => 'local_modules/freighthop'
9
+ mod 'apache', git: 'https://github.com/puppetlabs/puppetlabs-apache'
10
+ mod 'freighthop', path: 'local_modules/freighthop'
data/Puppetfile.lock CHANGED
@@ -1,9 +1,11 @@
1
1
  FORGE
2
2
  remote: http://forge.puppetlabs.com
3
3
  specs:
4
- gdsoperations/rbenv (1.0.1)
4
+ alup/rbenv (1.2.0)
5
5
  puppetlabs/apt (1.2.0)
6
6
  puppetlabs/stdlib (>= 2.2.1)
7
+ puppetlabs/concat (1.1.0-rc1)
8
+ puppetlabs/stdlib (>= 3.0.0)
7
9
  puppetlabs/firewall (0.4.2)
8
10
  puppetlabs/mysql (2.0.1)
9
11
  puppetlabs/stdlib (>= 2.2.1)
@@ -24,14 +26,24 @@ GIT
24
26
  puppetlabs/apt (>= 1.0.0)
25
27
  puppetlabs/stdlib (>= 0.1.6)
26
28
 
29
+ GIT
30
+ remote: https://github.com/puppetlabs/puppetlabs-apache
31
+ ref: master
32
+ sha: 739f2a69fe43413349f90f1ba7b95ae3bdc1b02a
33
+ specs:
34
+ apache (0.10.0)
35
+ puppetlabs/concat (>= 1.0.0)
36
+ puppetlabs/stdlib (>= 2.4.0)
37
+
27
38
  PATH
28
39
  remote: local_modules/freighthop
29
40
  specs:
30
41
  freighthop (0.0.1)
31
42
 
32
43
  DEPENDENCIES
44
+ alup/rbenv (>= 0)
45
+ apache (>= 0)
33
46
  freighthop (>= 0)
34
- gdsoperations/rbenv (>= 0)
35
47
  nginx (>= 0)
36
48
  puppetlabs/apt (>= 0)
37
49
  puppetlabs/mysql (>= 0)
data/Vagrantfile CHANGED
@@ -15,6 +15,8 @@ Vagrant.configure('2') do |config|
15
15
  config.cache.auto_detect = true
16
16
  config.cache.enable_nfs = Freighthop.nfs?
17
17
 
18
+ config.ssh.forward_agent = true
19
+
18
20
  config.vm.define Freighthop.app_name do |node_config|
19
21
  node_config.vm.hostname = Freighthop.hostname
20
22
 
@@ -57,7 +59,9 @@ Vagrant.configure('2') do |config|
57
59
  puppet.module_path = 'modules'
58
60
  puppet.manifest_file = 'site.pp'
59
61
  puppet.facter = {
60
- 'app_name' => Freighthop.app_name
62
+ 'app_name' => Freighthop.app_name,
63
+ 'freighthop_uid' => Process.uid,
64
+ 'freighthop_gid' => Process.gid,
61
65
  }
62
66
  end
63
67
  end
data/data/common.json CHANGED
@@ -1,5 +1,6 @@
1
1
  {
2
- "classes": [
3
- "freighthop"
4
- ]
2
+ "classes": ["freighthop"],
3
+ "freighthop::ppas": [],
4
+ "freighthop::packages": ["build-essential", "git"],
5
+ "freighthop::languages": []
5
6
  }
data/freighthop.gemspec CHANGED
@@ -23,6 +23,6 @@ Gem::Specification.new do |spec|
23
23
  spec.add_development_dependency 'guard-shell'
24
24
 
25
25
  spec.add_development_dependency 'puppet'
26
- spec.add_development_dependency 'librarian-puppet'
26
+ spec.add_development_dependency 'librarian-puppet', '~> 0.9.10'
27
27
  spec.add_development_dependency 'json'
28
28
  end
@@ -0,0 +1,12 @@
1
+ class Freighthop::CLI::Checks
2
+ def self.ensure_config_exists!
3
+ unless Freighthop::Config.exist?
4
+ puts <<-NO_CONFIG
5
+ ERROR: No freighthop config file (.freighthop.json) found in current path.
6
+ You can generate a template config with `fh init`, or see `fh help`
7
+ for more information.
8
+ NO_CONFIG
9
+ exit 1
10
+ end
11
+ end
12
+ end
@@ -29,6 +29,7 @@ SYNOPSIS
29
29
  fh <COMMAND> [args...]
30
30
 
31
31
  BUILT-IN COMMANDS
32
+ init - create a template freighthop config in the current dir
32
33
  up - boot freighthop vm
33
34
  halt - shutdown freighthop vm
34
35
  destroy - shutdown and delete vm
@@ -50,6 +51,12 @@ PASSTHROUGH TO VM
50
51
  them to behave properly.
51
52
 
52
53
  EXAMPLES
54
+ Get started with a fresh config:
55
+ fh init
56
+
57
+ Boot your Freighthop-managed VM:
58
+ fh up
59
+
53
60
  Install gem dependencies:
54
61
  fh bundle install
55
62
 
@@ -0,0 +1,35 @@
1
+ class Freighthop::CLI::Init
2
+ def self.match?(*args)
3
+ args.first == 'init'
4
+ end
5
+
6
+ attr_reader :language
7
+
8
+ def initialize(*args)
9
+ end
10
+
11
+ def run
12
+ if Freighthop::Config.exist?
13
+ puts "This directory already contains a #{Freighthop::Config.file.basename}"
14
+ exit 1
15
+ end
16
+
17
+ puts "Writing a new config to #{Freighthop::Config.file.basename}"
18
+ Freighthop::Config.write(default_config)
19
+ end
20
+
21
+ def default_config
22
+ {
23
+ 'freighthop::cpus' => 2,
24
+ 'freighthop::ram' => 512,
25
+ 'freighthop::languages' => ['ruby'],
26
+ 'freighthop::web::servers' => ['nginx'],
27
+ 'freighthop::web::nginx::upstream_port' => 3000,
28
+ 'freighthop::database::servers' => ['postgres'],
29
+ 'freighthop::database::postgres::db_names' => [],
30
+ 'freighthop::database::postgres::users' => [],
31
+ 'freighthop::ppas' => [],
32
+ 'freighthop::packages' => [],
33
+ }
34
+ end
35
+ end
@@ -8,6 +8,7 @@ class Freighthop::CLI::SSH
8
8
  end
9
9
 
10
10
  def run
11
+ Freighthop::CLI::Checks.ensure_config_exists!
11
12
  if shell?
12
13
  ssh('-i')
13
14
  else
@@ -21,6 +21,7 @@ class Freighthop::CLI::Vagrant
21
21
  end
22
22
 
23
23
  def run
24
+ Freighthop::CLI::Checks.ensure_config_exists!
24
25
  exec %Q(vagrant #{@subcommand} #{args})
25
26
  end
26
27
  end
@@ -1,12 +1,15 @@
1
1
  class Freighthop::CLI; end
2
2
 
3
+ require_relative 'cli/checks'
3
4
  require_relative 'cli/help'
5
+ require_relative 'cli/init'
4
6
  require_relative 'cli/ssh'
5
7
  require_relative 'cli/vagrant'
6
8
 
7
9
  class Freighthop::CLI
8
10
  COMMANDS = [
9
11
  Freighthop::CLI::Help,
12
+ Freighthop::CLI::Init,
10
13
  Freighthop::CLI::Vagrant,
11
14
  Freighthop::CLI::SSH,
12
15
  ]
@@ -16,25 +19,10 @@ class Freighthop::CLI
16
19
  end
17
20
 
18
21
  def run
19
- sanity_check
20
22
  Freighthop::VagrantEnv.activate!
21
23
 
22
- command = COMMANDS.detect(lambda{self.help}) { |c| c.match?(*@args) }
24
+ command = COMMANDS.detect { |c| c.match?(*@args) }
25
+ # no need for a nil check, because CLI::SSH will always match
23
26
  command.new(*@args).run
24
27
  end
25
-
26
- def help
27
- Freighthop::CLI::Help
28
- end
29
-
30
- def sanity_check
31
- return if help.match?(*@args)
32
- unless Freighthop::Config.exist?
33
- puts <<-NO_CONFIG
34
- ERROR: No freighthop config file (.freighthop.json) found in current path.
35
- You probably want to check out the README and/or `fh help`.
36
- NO_CONFIG
37
- exit 1
38
- end
39
- end
40
28
  end
@@ -8,10 +8,14 @@ class Freighthop::Config
8
8
  end
9
9
 
10
10
  def self.config
11
- @config = JSON.parse(file.read)
11
+ @config ||= JSON.parse(file.read)
12
12
  end
13
13
 
14
14
  def self.fetch(*args)
15
15
  config.fetch(*args)
16
16
  end
17
+
18
+ def self.write(config_hash)
19
+ file.open('w') { |f| f.puts(JSON.pretty_generate(config_hash)) }
20
+ end
17
21
  end
@@ -1,3 +1,3 @@
1
1
  module Freighthop
2
- VERSION = "0.2.1"
2
+ VERSION = "0.3.0"
3
3
  end
data/lib/freighthop.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  require 'pathname'
2
+ require 'json'
2
3
 
3
4
  require_relative 'freighthop/version'
4
5
  require_relative 'freighthop/config'
@@ -34,7 +35,11 @@ module Freighthop
34
35
  # For now only use NFS on vmware to work around this issue:
35
36
  # https://github.com/phinze/landrush/issues/17
36
37
  def nfs?
37
- vmware?
38
+ if ENV.key? 'FREIGHTHOP_NFS'
39
+ ['1','true','on'].include?(ENV['FREIGHTHOP_NFS'])
40
+ else
41
+ vmware?
42
+ end
38
43
  end
39
44
 
40
45
  def box_url
@@ -0,0 +1,11 @@
1
+ define freighthop::database::mysql::grant(
2
+ $user
3
+ ) {
4
+ mysql_grant { "freighthop_mysql_grant_for_${user}":
5
+ ensure => 'present',
6
+ options => ['GRANT'],
7
+ privileges => ['ALL'],
8
+ table => '*.*',
9
+ user => "${user}@%",
10
+ }
11
+ }
@@ -1,20 +1,10 @@
1
1
  class freighthop::database::mysql(
2
- $db_names,
2
+ $databases,
3
3
  $users,
4
4
  ) {
5
5
  include mysql::server
6
+ include mysql::client
6
7
 
7
- mysql::db{$db_names:
8
- user => "notorious",
9
- password => "notorious",
10
- host => "localhost",
11
- grant => ['All']
12
- }
13
- mysql_grant { $users:
14
- ensure => 'present',
15
- options => ['GRANT'],
16
- privileges => ['ALL'],
17
- table => '*.*',
18
- user => 'notorious@%',
19
- }
20
- }
8
+ mysql_database { $databases: } ->
9
+ freighthop::database::mysql::grant { $users: }
10
+ }
@@ -1,5 +1,5 @@
1
1
  class freighthop::database::postgres(
2
- $db_names,
2
+ $databases,
3
3
  $users,
4
4
  ) {
5
5
  include postgresql::server
@@ -19,7 +19,7 @@ class freighthop::database::postgres(
19
19
  auth_method => 'trust',
20
20
  order => '0001',
21
21
  }
22
- postgresql::server::database { $db_names: }
22
+ postgresql::server::database { $databases: }
23
23
  postgresql::server::role { $users:
24
24
  superuser => true,
25
25
  createdb => true,
@@ -1,10 +1,10 @@
1
1
  class freighthop::database(
2
- $flavors = []
2
+ $servers = []
3
3
  ) {
4
- if (member($flavors, 'postgres')) {
4
+ if member($servers, 'postgres') {
5
5
  class { 'freighthop::database::postgres':}
6
6
  }
7
- if (member($flavors, 'mysql')) {
7
+ if member($servers, 'mysql') {
8
8
  class { 'freighthop::database::mysql':}
9
9
  }
10
10
  }
@@ -1,35 +1,18 @@
1
1
  class freighthop(
2
- $ppas = $freighthop::params::ppas,
3
- $packages = $freighthop::params::packages,
4
- $languages = $freighthop::params::languages,
5
- $ruby_version = $freighthop::params::ruby_version,
6
- $app_name = $freighthop::params::app_name,
7
- $app_root = $freighthop::params::app_root,
8
- $web_root = $freighthop::params::web_root,
9
- $web_port = $freighthop::params::web_port,
10
- $server_name = $freighthop::params::server_name,
11
- $ssl_cert_path = $freighthop::params::ssl_cert_path,
12
- $ssl_key_path = $freighthop::params::ssl_key_path,
13
- ) inherits freighthop::params {
14
-
2
+ $ppas,
3
+ $packages,
4
+ $languages,
5
+ ) {
6
+ class { 'freighthop::params': } ->
15
7
  class { 'freighthop::packages':
16
8
  ppas => $ppas,
17
9
  packages => $packages,
18
- languages => $languages,
19
10
  } ->
20
11
 
21
12
  class { 'freighthop::language':
22
13
  languages => $languages,
23
- ruby_version => $ruby_version
24
- } ->
25
-
26
- class { 'freighthop::web':
27
- upstream_web_port => $web_port,
28
- server_name => $server_name,
29
- web_root => $web_root,
30
- ssl_cert_path => $ssl_cert_path,
31
- ssl_key_path => $ssl_key_path,
32
14
  } ->
33
15
 
16
+ class { 'freighthop::web': } ->
34
17
  class { 'freighthop::database':}
35
18
  }
@@ -1,29 +1,9 @@
1
1
  class freighthop::language::ruby(
2
- $version
2
+ $version = $freighthop::params::ruby_version
3
3
  ){
4
- class { '::rbenv':
5
- global_version => $version,
6
- }
7
-
8
- rbenv::version { $version: }
9
-
10
- # The rbenv puppet module drops $RBENV_ROOT/version but the package from
11
- # ppa:gds/govuk is an older version of rbenv that expects $RBENV_ROOT/global;
12
- # this is a workaround that uses the installed CLI to fix it.
13
- exec { 'fix-rbenv-global-version':
14
- command => "rbenv global ${version}",
15
- unless => "rbenv global | grep '${version}'",
16
- environment => 'RBENV_ROOT=/usr/lib/rbenv',
17
- require => Rbenv::Version[$version]
18
- }
19
-
20
- Exec {
21
- path => [
22
- '/usr/local/bin',
23
- '/usr/bin',
24
- '/usr/sbin',
25
- '/bin',
26
- '/sbin',
27
- ]
4
+ rbenv::install { 'vagrant': }
5
+ rbenv::compile { $version:
6
+ global => true,
7
+ user => 'vagrant',
28
8
  }
29
9
  }
@@ -1,11 +1,8 @@
1
1
  class freighthop::language(
2
2
  $languages,
3
- $ruby_version
4
3
  ) {
5
4
  if (member($languages, 'ruby')) {
6
- class { 'freighthop::language::ruby':
7
- version => $ruby_version,
8
- }
5
+ class { 'freighthop::language::ruby': }
9
6
  }
10
7
  if (member($languages, 'clojure')) {
11
8
  class { 'freighthop::language::clojure':
@@ -1,20 +1,10 @@
1
1
  class freighthop::packages(
2
2
  $ppas,
3
3
  $packages,
4
- $languages,
5
4
  ) {
6
- if (member($languages, 'ruby')) {
7
- apt::ppa { 'ppa:gds/govuk': }
8
- apt::ppa { 'ppa:phinze/rbenv': }
9
- }
10
- apt::ppa { $ppas: }
5
+ include apt
11
6
 
12
- package { [
13
- 'build-essential',
14
- 'git-core',
15
- ]:
16
- ensure => installed,
17
- }
7
+ apt::ppa { $ppas: }
18
8
 
19
9
  package { $packages:
20
10
  ensure => installed,
@@ -1,13 +1,21 @@
1
1
  class freighthop::params {
2
- $packages = []
3
- $ppas = []
4
- $languages = []
5
- $ruby_version = '1.9.3-p392'
6
- $app_name = $::hostname
7
- $app_root = "/srv/${app_name}"
8
- $web_root = "${app_root}/public"
9
- $web_port = 3000
10
- $server_name = $::fqdn
11
- $ssl_cert_path = "/etc/ssl/certs/${app_name}.pem"
12
- $ssl_key_path = "/etc/ssl/private/${app_name}.key"
2
+ $packages = []
3
+ $ppas = []
4
+ $languages = []
5
+ $ruby_version = '1.9.3-p392'
6
+ $app_name = $::hostname
7
+ $app_root = "/srv/${app_name}"
8
+ $web_servers = ['nginx']
9
+ $web_root = "${app_root}/public"
10
+ $http_port = 80
11
+ $https_port = 443
12
+ $upstream_port = 3000
13
+ $server_name = $::fqdn
14
+ $ssl = true
15
+ $ssl_cert_path = "/etc/ssl/certs/${app_name}.pem"
16
+ $ssl_key_path = "/etc/ssl/private/${app_name}.key"
17
+ $uid = $::freighthop_uid
18
+ $gid = $::freighthop_gid
19
+ $passenger = false
20
+ $passenger_buffer_upload = false
13
21
  }
@@ -0,0 +1,60 @@
1
+ class freighthop::web::apache(
2
+ $ssl,
3
+ $ssl_cert_path,
4
+ $ssl_key_path,
5
+ $server_name,
6
+ $port = $freighthop::params::http_port,
7
+ $ssl_port = $freighthop::params::https_port,
8
+ $upstream_port = $freighthop::params::upstream_port,
9
+ $owner = $freighthop::params::uid,
10
+ $group = $freighthop::params::gid,
11
+ $web_root = $freighthop::params::web_root,
12
+ $passenger = $freighthop::params::passenger,
13
+ $passenger_buffer_upload = $freighthop::params::passenger_buffer_upload,
14
+ ) {
15
+ class { '::apache':
16
+ default_vhost => false,
17
+ }
18
+ apache::vhost { "${server_name} non-ssl":
19
+ servername => $server_name,
20
+ docroot => $web_root,
21
+ port => $port,
22
+ docroot_owner => $owner,
23
+ docroot_group => $group,
24
+ }
25
+
26
+ if str2bool($ssl) {
27
+ apache::vhost { "${server_name} ssl":
28
+ servername => $server_name,
29
+ docroot => $web_root,
30
+ port => $ssl_port,
31
+ ssl => true,
32
+ ssl_cert => $ssl_cert_path,
33
+ ssl_key => $ssl_key_path,
34
+ }
35
+ }
36
+
37
+ if str2bool($passenger) {
38
+ package { 'apt-transport-https':
39
+ ensure => installed
40
+ } ->
41
+ apt::source { 'phusion':
42
+ location => 'https://oss-binaries.phusionpassenger.com/apt/passenger',
43
+ key => '561F9B9CAC40B2F7',
44
+ pin => 1000,
45
+ } ->
46
+ package { 'passenger':
47
+ ensure => 'installed'
48
+ } ->
49
+ apache::mod { 'passenger':
50
+ } ->
51
+ file { '/etc/apache2/conf.d/passenger.conf':
52
+ ensure => present,
53
+ owner => 'root',
54
+ group => 'root',
55
+ mode => '0644',
56
+ content => template('freighthop/apache/passenger.conf.erb'),
57
+ notify => Service['httpd'],
58
+ }
59
+ }
60
+ }
@@ -0,0 +1,22 @@
1
+ class freighthop::web::nginx(
2
+ $ssl,
3
+ $ssl_cert_path,
4
+ $ssl_key_path,
5
+ $server_name,
6
+ $port = $freighthop::params::http_port,
7
+ $ssl_port = $freighthop::params::https_port,
8
+ $upstream_port = $freighthop::params::upstream_port,
9
+ $web_root = $freighthop::params::web_root,
10
+ ) {
11
+ class {'::nginx':
12
+ confd_purge => true
13
+ }
14
+
15
+ file { '/etc/nginx/conf.d/vagrant-rails.conf':
16
+ owner => 'root',
17
+ group => 'root',
18
+ mode => '0644',
19
+ content => template('freighthop/nginx/vagrant-rails.conf.erb'),
20
+ notify => Service['nginx'],
21
+ }
22
+ }
@@ -0,0 +1,13 @@
1
+ class freighthop::web::ssl(
2
+ $server_name,
3
+ $ssl_cert_path,
4
+ $ssl_key_path,
5
+ ){
6
+ $cert_subject = "/C=US/ST=IL/L=Chicago/O=Freighthop/CN=${server_name}"
7
+
8
+ exec { 'generate-self-signed-ssl-cert':
9
+ command => "openssl req -x509 -nodes -days 3650 -subj '${cert_subject}' -newkey rsa:1024 -keyout ${ssl_key_path} -out ${ssl_cert_path}",
10
+ path => ['/usr/bin'],
11
+ creates => $ssl_cert_path,
12
+ }
13
+ }
@@ -1,28 +1,32 @@
1
1
  class freighthop::web(
2
- $upstream_web_port,
3
- $server_name,
4
- $web_root,
5
- $ssl_cert_path,
6
- $ssl_key_path,
2
+ $servers = $freighthop::params::web_servers,
3
+ $server_name = $freighthop::params::server_name,
4
+ $ssl = $freighthop::params::ssl,
5
+ $ssl_cert_path = $freighthop::params::ssl_cert_path,
6
+ $ssl_key_path = $freighthop::params::ssl_key_path,
7
7
  ) {
8
- $cert_subject = "/C=US/ST=IL/L=Chicago/O=Freighthop/CN=${server_name}"
9
-
10
- class {'::nginx':
11
- confd_purge => true
8
+ if $ssl {
9
+ class { 'freighthop::web::ssl':
10
+ ssl_cert_path => $ssl_cert_path,
11
+ ssl_key_path => $ssl_key_path,
12
+ server_name => $server_name,
13
+ }
12
14
  }
13
15
 
14
- exec { 'generate-self-signed-ssl-cert':
15
- command => "openssl req -x509 -nodes -days 3650 -subj '${cert_subject}' -newkey rsa:1024 -keyout ${ssl_key_path} -out ${ssl_cert_path}",
16
- path => ['/usr/bin'],
17
- creates => $ssl_cert_path,
16
+ if member($servers, 'nginx') {
17
+ class { 'freighthop::web::nginx':
18
+ ssl => $ssl,
19
+ ssl_cert_path => $ssl_cert_path,
20
+ ssl_key_path => $ssl_key_path,
21
+ server_name => $server_name,
22
+ }
18
23
  }
19
-
20
- file { '/etc/nginx/conf.d/vagrant-rails.conf':
21
- owner => 'root',
22
- group => 'root',
23
- mode => '0644',
24
- content => template('freighthop/nginx/vagrant-rails.conf.erb'),
25
- notify => Service['nginx'],
26
- require => Exec['generate-self-signed-ssl-cert'],
24
+ if member($servers, 'apache') {
25
+ class { 'freighthop::web::apache':
26
+ ssl => $ssl,
27
+ ssl_cert_path => $ssl_cert_path,
28
+ ssl_key_path => $ssl_key_path,
29
+ server_name => $server_name,
30
+ }
27
31
  }
28
32
  }
@@ -0,0 +1,18 @@
1
+ # Managed by Puppet; changes will be overwritten.
2
+ <IfModule mod_passenger.c>
3
+ # PassengerRoot comes straight from the phusion libapache2-mod-passenger
4
+ # package's stock config
5
+ PassengerRoot /usr/lib/ruby/vendor_ruby/phusion_passenger/locations.ini
6
+
7
+ # Points to the ruby interpreter that will be used to run applications
8
+ PassengerDefaultRuby /home/vagrant/.rbenv/shims/ruby
9
+
10
+ # Send uploads directly to Rack application without buffering them first.
11
+ # Allows application to deal in streams for large uploads.
12
+ # Requires Passenger 4.0.26 or higher; defaults to Off
13
+ <% if @passenger_buffer_upload -%>
14
+ PassengerBufferUpload On
15
+ <% else -%>
16
+ PassengerBufferUpload Off
17
+ <% end -%>
18
+ </IfModule>