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
@@ -0,0 +1,93 @@
1
+ # Passenger
2
+
3
+ Just enabling the Passenger module is insufficient for the use of Passenger in production. Passenger should be tunable to better fit the environment in which it is run while being aware of the resources it required.
4
+
5
+ To this end the Apache passenger module has been modified to apply system wide Passenger tuning declarations to `passenger.conf`. Declarations specific to a virtual host should be passed through when defining a `vhost` (e.g. `rack_base_uris' parameter on the `apache::vhost` class, check `README.md`).
6
+
7
+ # Parameters for `apache::mod::passenger`
8
+
9
+ The following declarations are supported and can be passed to `apache::mod::passenger` as parameters, for example:
10
+
11
+ ```
12
+ class {'apache::mod::passenger':
13
+ passenger_high_performance => 'on',
14
+ rails_autodetect => 'off',
15
+ }
16
+ ```
17
+
18
+ The general form is using the all lower case version of the declaration.
19
+
20
+ If you pass a default value to `apache::mod::passenger` it will be ignored and not passed through to the configuration file.
21
+
22
+ ## passenger_high_performance
23
+
24
+ Default is `off`, when turned `on` Passenger runs in a higher performance mode that can be less compatible with other Apache modules.
25
+
26
+ http://www.modrails.com/documentation/Users%20guide%20Apache.html#PassengerHighPerformance
27
+
28
+ ## passenger_max_pool_size
29
+
30
+ Set's the maximum number of Passenger application processes that may simultaneously run. The default value is 6.
31
+
32
+ http://www.modrails.com/documentation/Users%20guide%20Apache.html#_passengermaxpoolsize_lt_integer_gt
33
+
34
+ ## passenger_pool_idle_time
35
+
36
+ The maximum number of seconds a Passenger Application process will be allowed to remain idle before being shut down. The default value is 300.
37
+
38
+ http://www.modrails.com/documentation/Users%20guide%20Apache.html#PassengerPoolIdleTime
39
+
40
+ ## passenger_max_requests
41
+
42
+ The maximum number of request a Passenger application will process before being restarted. The default value is 0, which indicates that a process will only shut down if the Pool Idle Time (see above) expires.
43
+
44
+ http://www.modrails.com/documentation/Users%20guide%20Apache.html#PassengerMaxRequests
45
+
46
+ ## passenger_stat_throttle_rate
47
+
48
+ Sets how often Passenger performs file system checks, at most once every _x_ seconds. Default is 0, which means the checks are performed with every request.
49
+
50
+ http://www.modrails.com/documentation/Users%20guide%20Apache.html#_passengerstatthrottlerate_lt_integer_gt
51
+
52
+ ## rack_auto_detect
53
+
54
+ Should Passenger automatically detect if the document root of a virtual host is a Rack application. The default is `on`
55
+
56
+ http://www.modrails.com/documentation/Users%20guide%20Apache.html#_rackautodetect_lt_on_off_gt
57
+
58
+ ## rails_auto_detect
59
+
60
+ Should Passenger automatically detect if the document root of a virtual host is a Rails application. The default is on.
61
+
62
+ http://www.modrails.com/documentation/Users%20guide%20Apache.html#_railsautodetect_lt_on_off_gt
63
+
64
+ ## passenger_use_global_queue
65
+
66
+ Allows toggling of PassengerUseGlobalQueue. NOTE: PassengerUseGlobalQueue is the default in Passenger 4.x and the versions >= 4.x have disabled this configuration option altogether. Use with caution.
67
+
68
+ # Attribution
69
+
70
+ The Passenger tuning parameters for the `apache::mod::puppet` Puppet class was modified by Aaron Hicks (hicksa@landcareresearch.co.nz) for work on the NeSI Project and the Tuakiri New Zealand Access Federation as a fork from the PuppetLabs Apache module on GitHub.
71
+
72
+ * https://github.com/puppetlabs/puppetlabs-apache
73
+ * https://github.com/nesi/puppetlabs-apache
74
+ * http://www.nesi.org.nz//
75
+ * https://tuakiri.ac.nz/confluence/display/Tuakiri/Home
76
+
77
+ # Copyright and License
78
+
79
+ Copyright (C) 2012 [Puppet Labs](https://www.puppetlabs.com/) Inc
80
+
81
+ Puppet Labs can be contacted at: info@puppetlabs.com
82
+
83
+ Licensed under the Apache License, Version 2.0 (the "License");
84
+ you may not use this file except in compliance with the License.
85
+ You may obtain a copy of the License at
86
+
87
+ http://www.apache.org/licenses/LICENSE-2.0
88
+
89
+ Unless required by applicable law or agreed to in writing, software
90
+ distributed under the License is distributed on an "AS IS" BASIS,
91
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
92
+ See the License for the specific language governing permissions and
93
+ limitations under the License.
@@ -0,0 +1 @@
1
+ require 'puppetlabs_spec_helper/rake_tasks'
@@ -0,0 +1,24 @@
1
+ # Configuration file for the httpd service.
2
+
3
+ #
4
+ # The default processing model (MPM) is the process-based
5
+ # 'prefork' model. A thread-based model, 'worker', is also
6
+ # available, but does not work with some modules (such as PHP).
7
+ # The service must be stopped before changing this variable.
8
+ #
9
+ #HTTPD=/usr/sbin/httpd.worker
10
+
11
+ #
12
+ # To pass additional options (for instance, -D definitions) to the
13
+ # httpd binary at startup, set OPTIONS here.
14
+ #
15
+ #OPTIONS=
16
+ #OPTIONS=-DDOWN
17
+
18
+ #
19
+ # By default, the httpd process is started in the C locale; to
20
+ # change the locale in which the server runs, the HTTPD_LANG
21
+ # variable can be set.
22
+ #
23
+ #HTTPD_LANG=C
24
+ export SHORTHOST=`hostname -s`
@@ -0,0 +1,35 @@
1
+ require 'puppet/provider/a2mod'
2
+
3
+ Puppet::Type.type(:a2mod).provide(:a2mod, :parent => Puppet::Provider::A2mod) do
4
+ desc "Manage Apache 2 modules on Debian and Ubuntu"
5
+
6
+ optional_commands :encmd => "a2enmod"
7
+ optional_commands :discmd => "a2dismod"
8
+ commands :apache2ctl => "apache2ctl"
9
+
10
+ confine :osfamily => :debian
11
+ defaultfor :operatingsystem => [:debian, :ubuntu]
12
+
13
+ def self.instances
14
+ modules = apache2ctl("-M").lines.collect { |line|
15
+ m = line.match(/(\w+)_module \(shared\)$/)
16
+ m[1] if m
17
+ }.compact
18
+
19
+ modules.map do |mod|
20
+ new(
21
+ :name => mod,
22
+ :ensure => :present,
23
+ :provider => :a2mod
24
+ )
25
+ end
26
+ end
27
+
28
+ def create
29
+ encmd resource[:name]
30
+ end
31
+
32
+ def destroy
33
+ discmd resource[:name]
34
+ end
35
+ end
@@ -0,0 +1,116 @@
1
+ require 'puppet/util/filetype'
2
+ Puppet::Type.type(:a2mod).provide(:gentoo, :parent => Puppet::Provider) do
3
+ desc "Manage Apache 2 modules on Gentoo"
4
+
5
+ confine :operatingsystem => :gentoo
6
+ defaultfor :operatingsystem => :gentoo
7
+
8
+ attr_accessor :property_hash
9
+
10
+ def create
11
+ @property_hash[:ensure] = :present
12
+ end
13
+
14
+ def exists?
15
+ (!(@property_hash[:ensure].nil?) and @property_hash[:ensure] == :present)
16
+ end
17
+
18
+ def destroy
19
+ @property_hash[:ensure] = :absent
20
+ end
21
+
22
+ def flush
23
+ self.class.flush
24
+ end
25
+
26
+ class << self
27
+ attr_reader :conf_file
28
+ end
29
+
30
+ def self.clear
31
+ @mod_resources = []
32
+ @modules = []
33
+ @other_args = ""
34
+ end
35
+
36
+ def self.initvars
37
+ @conf_file = "/etc/conf.d/apache2"
38
+ @filetype = Puppet::Util::FileType.filetype(:flat).new(conf_file)
39
+ @mod_resources = []
40
+ @modules = []
41
+ @other_args = ""
42
+ end
43
+
44
+ self.initvars
45
+
46
+ # Retrieve an array of all existing modules
47
+ def self.modules
48
+ if @modules.length <= 0
49
+ # Locate the APACHE_OPTS variable
50
+ records = filetype.read.split(/\n/)
51
+ apache2_opts = records.grep(/^\s*APACHE2_OPTS=/).first
52
+
53
+ # Extract all defines
54
+ while apache2_opts.sub!(/-D\s+(\w+)/, '')
55
+ @modules << $1.downcase
56
+ end
57
+
58
+ # Hang on to any remaining options.
59
+ if apache2_opts.match(/APACHE2_OPTS="(.+)"/)
60
+ @other_args = $1.strip
61
+ end
62
+
63
+ @modules.sort!.uniq!
64
+ end
65
+
66
+ @modules
67
+ end
68
+
69
+ def self.prefetch(resources={})
70
+ # Match resources with existing providers
71
+ instances.each do |provider|
72
+ if resource = resources[provider.name]
73
+ resource.provider = provider
74
+ end
75
+ end
76
+
77
+ # Store all resources using this provider for flushing
78
+ resources.each do |name, resource|
79
+ @mod_resources << resource
80
+ end
81
+ end
82
+
83
+ def self.instances
84
+ modules.map {|mod| new(:name => mod, :provider => :gentoo, :ensure => :present)}
85
+ end
86
+
87
+ def self.flush
88
+
89
+ mod_list = modules
90
+ mods_to_remove = @mod_resources.select {|mod| mod.should(:ensure) == :absent}.map {|mod| mod[:name]}
91
+ mods_to_add = @mod_resources.select {|mod| mod.should(:ensure) == :present}.map {|mod| mod[:name]}
92
+
93
+ mod_list -= mods_to_remove
94
+ mod_list += mods_to_add
95
+ mod_list.sort!.uniq!
96
+
97
+ if modules != mod_list
98
+ opts = @other_args + " "
99
+ opts << mod_list.map {|mod| "-D #{mod.upcase}"}.join(" ")
100
+ opts.strip!
101
+ opts.gsub!(/\s+/, ' ')
102
+
103
+ apache2_opts = %Q{APACHE2_OPTS="#{opts}"}
104
+ Puppet.debug("Writing back \"#{apache2_opts}\" to #{conf_file}")
105
+
106
+ records = filetype.read.split(/\n/)
107
+
108
+ opts_index = records.find_index {|i| i.match(/^\s*APACHE2_OPTS/)}
109
+ records[opts_index] = apache2_opts
110
+
111
+ filetype.backup
112
+ filetype.write(records.join("\n"))
113
+ @modules = mod_list
114
+ end
115
+ end
116
+ end
@@ -0,0 +1,12 @@
1
+ Puppet::Type.type(:a2mod).provide :modfix do
2
+ desc "Dummy provider for A2mod.
3
+
4
+ Fake nil resources when there is no crontab binary available. Allows
5
+ puppetd to run on a bootstrapped machine before a Cron package has been
6
+ installed. Workaround for: http://projects.puppetlabs.com/issues/2384
7
+ "
8
+
9
+ def self.instances
10
+ []
11
+ end
12
+ end
@@ -0,0 +1,60 @@
1
+ require 'puppet/provider/a2mod'
2
+
3
+ Puppet::Type.type(:a2mod).provide(:redhat, :parent => Puppet::Provider::A2mod) do
4
+ desc "Manage Apache 2 modules on RedHat family OSs"
5
+
6
+ commands :apachectl => "apachectl"
7
+
8
+ confine :osfamily => :redhat
9
+ defaultfor :osfamily => :redhat
10
+
11
+ require 'pathname'
12
+
13
+ # modpath: Path to default apache modules directory /etc/httpd/mod.d
14
+ # modfile: Path to module load configuration file; Default: resides under modpath directory
15
+ # libfile: Path to actual apache module library. Added in modfile LoadModule
16
+
17
+ attr_accessor :modfile, :libfile
18
+ class << self
19
+ attr_accessor :modpath
20
+ def preinit
21
+ @modpath = "/etc/httpd/mod.d"
22
+ end
23
+ end
24
+
25
+ self.preinit
26
+
27
+ def create
28
+ File.open(modfile,'w') do |f|
29
+ f.puts "LoadModule #{resource[:identifier]} #{libfile}"
30
+ end
31
+ end
32
+
33
+ def destroy
34
+ File.delete(modfile)
35
+ end
36
+
37
+ def self.instances
38
+ modules = apachectl("-M").lines.collect { |line|
39
+ m = line.match(/(\w+)_module \(shared\)$/)
40
+ m[1] if m
41
+ }.compact
42
+
43
+ modules.map do |mod|
44
+ new(
45
+ :name => mod,
46
+ :ensure => :present,
47
+ :provider => :redhat
48
+ )
49
+ end
50
+ end
51
+
52
+ def modfile
53
+ modfile ||= "#{self.class.modpath}/#{resource[:name]}.load"
54
+ end
55
+
56
+ # Set libfile path: If absolute path is passed, then maintain it. Else, make it default from 'modules' dir.
57
+ def libfile
58
+ libfile = Pathname.new(resource[:lib]).absolute? ? resource[:lib] : "modules/#{resource[:lib]}"
59
+ end
60
+ end
@@ -0,0 +1,34 @@
1
+ class Puppet::Provider::A2mod < Puppet::Provider
2
+ def self.prefetch(mods)
3
+ instances.each do |prov|
4
+ if mod = mods[prov.name]
5
+ mod.provider = prov
6
+ end
7
+ end
8
+ end
9
+
10
+ def flush
11
+ @property_hash.clear
12
+ end
13
+
14
+ def properties
15
+ if @property_hash.empty?
16
+ @property_hash = query || {:ensure => :absent}
17
+ @property_hash[:ensure] = :absent if @property_hash.empty?
18
+ end
19
+ @property_hash.dup
20
+ end
21
+
22
+ def query
23
+ self.class.instances.each do |mod|
24
+ if mod.name == self.name or mod.name.downcase == self.name
25
+ return mod.properties
26
+ end
27
+ end
28
+ nil
29
+ end
30
+
31
+ def exists?
32
+ properties[:ensure] != :absent
33
+ end
34
+ end
@@ -0,0 +1,30 @@
1
+ Puppet::Type.newtype(:a2mod) do
2
+ @doc = "Manage Apache 2 modules"
3
+
4
+ ensurable
5
+
6
+ newparam(:name) do
7
+ Puppet.warning "The a2mod provider is deprecated, please use apache::mod instead"
8
+ desc "The name of the module to be managed"
9
+
10
+ isnamevar
11
+
12
+ end
13
+
14
+ newparam(:lib) do
15
+ desc "The name of the .so library to be loaded"
16
+
17
+ defaultto { "mod_#{@resource[:name]}.so" }
18
+ end
19
+
20
+ newparam(:identifier) do
21
+ desc "Module identifier string used by LoadModule. Default: module-name_module"
22
+
23
+ # http://httpd.apache.org/docs/2.2/mod/module-dict.html#ModuleIdentifier
24
+
25
+ defaultto { "#{resource[:name]}_module" }
26
+ end
27
+
28
+ autorequire(:package) { catalog.resource(:package, 'httpd')}
29
+
30
+ end
@@ -0,0 +1,80 @@
1
+ # == Define Resource Type: apache::balancer
2
+ #
3
+ # This type will create an apache balancer cluster file inside the conf.d
4
+ # directory. Each balancer cluster needs one or more balancer members (that can
5
+ # be declared with the apache::balancermember defined resource type). Using
6
+ # storeconfigs, you can export the apache::balancermember resources on all
7
+ # balancer members, and then collect them on a single apache load balancer
8
+ # server.
9
+ #
10
+ # === Requirement/Dependencies:
11
+ #
12
+ # Currently requires the puppetlabs/concat module on the Puppet Forge and uses
13
+ # storeconfigs on the Puppet Master to export/collect resources from all
14
+ # balancer members.
15
+ #
16
+ # === Parameters
17
+ #
18
+ # [*name*]
19
+ # The namevar of the defined resource type is the balancer clusters name.
20
+ # This name is also used in the name of the conf.d file
21
+ #
22
+ # [*proxy_set*]
23
+ # Hash, default empty. If given, each key-value pair will be used as a ProxySet
24
+ # line in the configuration.
25
+ #
26
+ # [*collect_exported*]
27
+ # Boolean, default 'true'. True means 'collect exported @@balancermember
28
+ # resources' (for the case when every balancermember node exports itself),
29
+ # false means 'rely on the existing declared balancermember resources' (for the
30
+ # case when you know the full set of balancermembers in advance and use
31
+ # apache::balancermember with array arguments, which allows you to deploy
32
+ # everything in 1 run)
33
+ #
34
+ #
35
+ # === Examples
36
+ #
37
+ # Exporting the resource for a balancer member:
38
+ #
39
+ # apache::balancer { 'puppet00': }
40
+ #
41
+ define apache::balancer (
42
+ $proxy_set = {},
43
+ $collect_exported = true,
44
+ ) {
45
+ include concat::setup
46
+ include apache::mod::proxy_balancer
47
+
48
+ $target = "${::apache::params::confd_dir}/balancer_${name}.conf"
49
+
50
+ concat { $target:
51
+ owner => '0',
52
+ group => '0',
53
+ mode => '0644',
54
+ notify => Service['httpd'],
55
+ }
56
+
57
+ concat::fragment { "00-${name}-header":
58
+ target => $target,
59
+ order => '01',
60
+ content => "<Proxy balancer://${name}>\n",
61
+ }
62
+
63
+ if $collect_exported {
64
+ Apache::Balancermember <<| balancer_cluster == $name |>>
65
+ }
66
+ # else: the resources have been created and they introduced their
67
+ # concat fragments. We don't have to do anything about them.
68
+
69
+ concat::fragment { "01-${name}-proxyset":
70
+ target => $target,
71
+ order => '19',
72
+ content => inline_template("<% proxy_set.each do |key, value| %> Proxyset <%= key %>=<%= value %>\n<% end %>"),
73
+ }
74
+
75
+ concat::fragment { "01-${name}-footer":
76
+ target => $target,
77
+ order => '20',
78
+ content => "</Proxy>\n",
79
+ }
80
+ }
@@ -0,0 +1,52 @@
1
+ # == Define Resource Type: apache::balancermember
2
+ #
3
+ # This type will setup a balancer member inside a listening service
4
+ # configuration block in /etc/apache/apache.cfg on the load balancer.
5
+ # currently it only has the ability to specify the instance name, url and an
6
+ # array of options. More features can be added as needed. The best way to
7
+ # implement this is to export this resource for all apache balancer member
8
+ # servers, and then collect them on the main apache load balancer.
9
+ #
10
+ # === Requirement/Dependencies:
11
+ #
12
+ # Currently requires the puppetlabs/concat module on the Puppet Forge and
13
+ # uses storeconfigs on the Puppet Master to export/collect resources
14
+ # from all balancer members.
15
+ #
16
+ # === Parameters
17
+ #
18
+ # [*name*]
19
+ # The title of the resource is arbitrary and only utilized in the concat
20
+ # fragment name.
21
+ #
22
+ # [*balancer_cluster*]
23
+ # The apache service's instance name (or, the title of the apache::balancer
24
+ # resource). This must match up with a declared apache::balancer resource.
25
+ #
26
+ # [*url*]
27
+ # The url used to contact the balancer member server.
28
+ #
29
+ # [*options*]
30
+ # An array of options to be specified after the url.
31
+ #
32
+ # === Examples
33
+ #
34
+ # Exporting the resource for a balancer member:
35
+ #
36
+ # @@apache::balancermember { 'apache':
37
+ # balancer_cluster => 'puppet00',
38
+ # url => "ajp://${::fqdn}:8009"
39
+ # options => ['ping=5', 'disablereuse=on', 'retry=5', 'ttl=120'],
40
+ # }
41
+ #
42
+ define apache::balancermember(
43
+ $balancer_cluster,
44
+ $url = "http://${::fqdn}/",
45
+ $options = [],
46
+ ) {
47
+
48
+ concat::fragment { "BalancerMember ${url}":
49
+ target => "${::apache::params::confd_dir}/balancer_${balancer_cluster}.conf",
50
+ content => inline_template(" BalancerMember ${url} <%= @options.join ' ' %>\n"),
51
+ }
52
+ }
@@ -0,0 +1,10 @@
1
+ class apache::confd::no_accf {
2
+ # Template uses no variables
3
+ file { 'no-accf.conf':
4
+ ensure => 'file',
5
+ path => "${apache::confd_dir}/no-accf.conf",
6
+ content => template('apache/confd/no-accf.conf.erb'),
7
+ require => Exec["mkdir ${apache::confd_dir}"],
8
+ before => File[$apache::confd_dir],
9
+ }
10
+ }
@@ -0,0 +1,12 @@
1
+ class apache::default_confd_files (
2
+ $all = true,
3
+ ) {
4
+ # The rest of the conf.d/* files only get loaded if we want them
5
+ if $all {
6
+ case $::osfamily {
7
+ 'freebsd': {
8
+ include apache::confd::no_accf
9
+ }
10
+ }
11
+ }
12
+ }
@@ -0,0 +1,8 @@
1
+ # private define
2
+ define apache::default_mods::load ($module = $title) {
3
+ if defined("apache::mod::${module}") {
4
+ include "apache::mod::${module}"
5
+ } else {
6
+ apache::mod { $module: }
7
+ }
8
+ }
@@ -0,0 +1,108 @@
1
+ class apache::default_mods (
2
+ $all = true,
3
+ $mods = undef,
4
+ ) {
5
+ # These are modules required to run the default configuration.
6
+ # They are not configurable at this time, so we just include
7
+ # them to make sure it works.
8
+ case $::osfamily {
9
+ 'redhat', 'freebsd': {
10
+ apache::mod { 'log_config': }
11
+ }
12
+ default: {}
13
+ }
14
+ apache::mod { 'authz_host': }
15
+
16
+ # The rest of the modules only get loaded if we want all modules enabled
17
+ if $all {
18
+ case $::osfamily {
19
+ 'debian': {
20
+ include apache::mod::reqtimeout
21
+ }
22
+ 'redhat': {
23
+ include apache::mod::cache
24
+ include apache::mod::mime
25
+ include apache::mod::mime_magic
26
+ include apache::mod::vhost_alias
27
+ include apache::mod::rewrite
28
+ apache::mod { 'actions': }
29
+ apache::mod { 'auth_digest': }
30
+ apache::mod { 'authn_alias': }
31
+ apache::mod { 'authn_anon': }
32
+ apache::mod { 'authn_dbm': }
33
+ apache::mod { 'authn_default': }
34
+ apache::mod { 'authz_dbm': }
35
+ apache::mod { 'authz_owner': }
36
+ apache::mod { 'expires': }
37
+ apache::mod { 'ext_filter': }
38
+ apache::mod { 'include': }
39
+ apache::mod { 'logio': }
40
+ apache::mod { 'speling': }
41
+ apache::mod { 'substitute': }
42
+ apache::mod { 'suexec': }
43
+ apache::mod { 'usertrack': }
44
+ apache::mod { 'version': }
45
+ }
46
+ 'freebsd': {
47
+ include apache::mod::cache
48
+ include apache::mod::disk_cache
49
+ include apache::mod::headers
50
+ include apache::mod::info
51
+ include apache::mod::mime_magic
52
+ include apache::mod::reqtimeout
53
+ include apache::mod::rewrite
54
+ include apache::mod::userdir
55
+ include apache::mod::vhost_alias
56
+
57
+ apache::mod { 'actions': }
58
+ apache::mod { 'asis': }
59
+ apache::mod { 'auth_digest': }
60
+ apache::mod { 'authn_alias': }
61
+ apache::mod { 'authn_anon': }
62
+ apache::mod { 'authn_dbm': }
63
+ apache::mod { 'authn_default': }
64
+ apache::mod { 'authz_dbm': }
65
+ apache::mod { 'authz_owner': }
66
+ apache::mod { 'cern_meta': }
67
+ apache::mod { 'charset_lite': }
68
+ apache::mod { 'dumpio': }
69
+ apache::mod { 'expires': }
70
+ apache::mod { 'file_cache': }
71
+ apache::mod { 'filter':}
72
+ apache::mod { 'imagemap':}
73
+ apache::mod { 'include': }
74
+ apache::mod { 'logio': }
75
+ apache::mod { 'speling': }
76
+ apache::mod { 'unique_id': }
77
+ apache::mod { 'usertrack': }
78
+ apache::mod { 'version': }
79
+ }
80
+ default: {}
81
+ }
82
+ case $apache::mpm_module {
83
+ 'prefork': {
84
+ include apache::mod::cgi
85
+ }
86
+ 'worker': {
87
+ include apache::mod::cgid
88
+ }
89
+ }
90
+ include apache::mod::alias
91
+ include apache::mod::autoindex
92
+ include apache::mod::dav
93
+ include apache::mod::dav_fs
94
+ include apache::mod::deflate
95
+ include apache::mod::dir
96
+ include apache::mod::mime
97
+ include apache::mod::negotiation
98
+ include apache::mod::setenvif
99
+ apache::mod { 'auth_basic': }
100
+ apache::mod { 'authn_file': }
101
+ apache::mod { 'authz_default': }
102
+ apache::mod { 'authz_groupfile': }
103
+ apache::mod { 'authz_user': }
104
+ apache::mod { 'env': }
105
+ } elsif $mods {
106
+ apache::default_mods::load { $mods: }
107
+ }
108
+ }