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,11 @@
1
+ class apache::dev {
2
+ if $::osfamily == 'FreeBSD' and !defined(Class['apache::package']) {
3
+ fail('apache::dev requires apache::package; please include apache or apache::package class first')
4
+ }
5
+ include apache::params
6
+ $packages = $apache::params::dev_packages
7
+ package { $packages:
8
+ ensure => present,
9
+ require => Package['httpd'],
10
+ }
11
+ }
@@ -0,0 +1,329 @@
1
+ # Class: apache
2
+ #
3
+ # This class installs Apache
4
+ #
5
+ # Parameters:
6
+ #
7
+ # Actions:
8
+ # - Install Apache
9
+ # - Manage Apache service
10
+ #
11
+ # Requires:
12
+ #
13
+ # Sample Usage:
14
+ #
15
+ class apache (
16
+ $service_name = $apache::params::service_name,
17
+ $default_mods = true,
18
+ $default_vhost = true,
19
+ $default_confd_files = true,
20
+ $default_ssl_vhost = false,
21
+ $default_ssl_cert = $apache::params::default_ssl_cert,
22
+ $default_ssl_key = $apache::params::default_ssl_key,
23
+ $default_ssl_chain = undef,
24
+ $default_ssl_ca = undef,
25
+ $default_ssl_crl_path = undef,
26
+ $default_ssl_crl = undef,
27
+ $ip = undef,
28
+ $service_enable = true,
29
+ $service_ensure = 'running',
30
+ $purge_configs = true,
31
+ $purge_vdir = false,
32
+ $serveradmin = 'root@localhost',
33
+ $sendfile = 'On',
34
+ $error_documents = false,
35
+ $timeout = '120',
36
+ $httpd_dir = $apache::params::httpd_dir,
37
+ $server_root = $apache::params::server_root,
38
+ $confd_dir = $apache::params::confd_dir,
39
+ $vhost_dir = $apache::params::vhost_dir,
40
+ $vhost_enable_dir = $apache::params::vhost_enable_dir,
41
+ $mod_dir = $apache::params::mod_dir,
42
+ $mod_enable_dir = $apache::params::mod_enable_dir,
43
+ $mpm_module = $apache::params::mpm_module,
44
+ $conf_template = $apache::params::conf_template,
45
+ $servername = $apache::params::servername,
46
+ $manage_user = true,
47
+ $manage_group = true,
48
+ $user = $apache::params::user,
49
+ $group = $apache::params::group,
50
+ $keepalive = $apache::params::keepalive,
51
+ $keepalive_timeout = $apache::params::keepalive_timeout,
52
+ $logroot = $apache::params::logroot,
53
+ $log_level = $apache::params::log_level,
54
+ $ports_file = $apache::params::ports_file,
55
+ $server_tokens = 'OS',
56
+ $server_signature = 'On',
57
+ $trace_enable = 'On',
58
+ $package_ensure = 'installed',
59
+ ) inherits apache::params {
60
+
61
+ validate_bool($default_vhost)
62
+ validate_bool($default_ssl_vhost)
63
+ validate_bool($default_confd_files)
64
+ # true/false is sufficient for both ensure and enable
65
+ validate_bool($service_enable)
66
+
67
+ $valid_mpms_re = $::osfamily ? {
68
+ 'FreeBSD' => '(event|itk|peruser|prefork|worker)',
69
+ default => '(itk|prefork|worker)'
70
+ }
71
+
72
+ if $mpm_module {
73
+ validate_re($mpm_module, $valid_mpms_re)
74
+ }
75
+
76
+ # NOTE: on FreeBSD it's mpm module's responsibility to install httpd package.
77
+ # NOTE: the same strategy may be introduced for other OSes. For this, you
78
+ # should delete the 'if' block below and modify all MPM modules' manifests
79
+ # such that they include apache::package class (currently event.pp, itk.pp,
80
+ # peruser.pp, prefork.pp, worker.pp).
81
+ if $::osfamily != 'FreeBSD' {
82
+ package { 'httpd':
83
+ ensure => $package_ensure,
84
+ name => $apache::params::apache_name,
85
+ notify => Class['Apache::Service'],
86
+ }
87
+ }
88
+ validate_re($sendfile, [ '^[oO]n$' , '^[oO]ff$' ])
89
+
90
+ # declare the web server user and group
91
+ # Note: requiring the package means the package ought to create them and not puppet
92
+ validate_bool($manage_user)
93
+ if $manage_user {
94
+ user { $user:
95
+ ensure => present,
96
+ gid => $group,
97
+ require => Package['httpd'],
98
+ }
99
+ }
100
+ validate_bool($manage_group)
101
+ if $manage_group {
102
+ group { $group:
103
+ ensure => present,
104
+ require => Package['httpd']
105
+ }
106
+ }
107
+
108
+ $valid_log_level_re = '(emerg|alert|crit|error|warn|notice|info|debug)'
109
+
110
+ validate_re($log_level, $valid_log_level_re,
111
+ "Log level '${log_level}' is not one of the supported Apache HTTP Server log levels.")
112
+
113
+ class { 'apache::service':
114
+ service_name => $service_name,
115
+ service_enable => $service_enable,
116
+ service_ensure => $service_ensure,
117
+ }
118
+
119
+ # Deprecated backwards-compatibility
120
+ if $purge_vdir {
121
+ warning('Class[\'apache\'] parameter purge_vdir is deprecated in favor of purge_configs')
122
+ $purge_confd = $purge_vdir
123
+ } else {
124
+ $purge_confd = $purge_configs
125
+ }
126
+
127
+ Exec {
128
+ path => '/bin:/sbin:/usr/bin:/usr/sbin',
129
+ }
130
+
131
+ exec { "mkdir ${confd_dir}":
132
+ creates => $confd_dir,
133
+ require => Package['httpd'],
134
+ }
135
+ file { $confd_dir:
136
+ ensure => directory,
137
+ recurse => true,
138
+ purge => $purge_confd,
139
+ notify => Class['Apache::Service'],
140
+ require => Package['httpd'],
141
+ }
142
+
143
+ if ! defined(File[$mod_dir]) {
144
+ exec { "mkdir ${mod_dir}":
145
+ creates => $mod_dir,
146
+ require => Package['httpd'],
147
+ }
148
+ file { $mod_dir:
149
+ ensure => directory,
150
+ recurse => true,
151
+ purge => $purge_configs,
152
+ notify => Class['Apache::Service'],
153
+ require => Package['httpd'],
154
+ }
155
+ }
156
+
157
+ if $mod_enable_dir and ! defined(File[$mod_enable_dir]) {
158
+ $mod_load_dir = $mod_enable_dir
159
+ exec { "mkdir ${mod_enable_dir}":
160
+ creates => $mod_enable_dir,
161
+ require => Package['httpd'],
162
+ }
163
+ file { $mod_enable_dir:
164
+ ensure => directory,
165
+ recurse => true,
166
+ purge => $purge_configs,
167
+ notify => Class['Apache::Service'],
168
+ require => Package['httpd'],
169
+ }
170
+ } else {
171
+ $mod_load_dir = $mod_dir
172
+ }
173
+
174
+ if ! defined(File[$vhost_dir]) {
175
+ exec { "mkdir ${vhost_dir}":
176
+ creates => $vhost_dir,
177
+ require => Package['httpd'],
178
+ }
179
+ file { $vhost_dir:
180
+ ensure => directory,
181
+ recurse => true,
182
+ purge => $purge_configs,
183
+ notify => Class['Apache::Service'],
184
+ require => Package['httpd'],
185
+ }
186
+ }
187
+
188
+ if $vhost_enable_dir and ! defined(File[$vhost_enable_dir]) {
189
+ $vhost_load_dir = $vhost_enable_dir
190
+ exec { "mkdir ${vhost_load_dir}":
191
+ creates => $vhost_load_dir,
192
+ require => Package['httpd'],
193
+ }
194
+ file { $vhost_enable_dir:
195
+ ensure => directory,
196
+ recurse => true,
197
+ purge => $purge_configs,
198
+ notify => Class['Apache::Service'],
199
+ require => Package['httpd'],
200
+ }
201
+ } else {
202
+ $vhost_load_dir = $vhost_dir
203
+ }
204
+
205
+ concat { $ports_file:
206
+ owner => 'root',
207
+ group => $apache::params::root_group,
208
+ mode => '0644',
209
+ notify => Class['Apache::Service'],
210
+ require => Package['httpd'],
211
+ }
212
+ concat::fragment { 'Apache ports header':
213
+ target => $ports_file,
214
+ content => template('apache/ports_header.erb')
215
+ }
216
+
217
+ if $apache::params::conf_dir and $apache::params::conf_file {
218
+ if $::osfamily == 'redhat' or $::operatingsystem == 'amazon' {
219
+ $docroot = '/var/www/html'
220
+ $pidfile = 'run/httpd.pid'
221
+ $error_log = 'error_log'
222
+ $error_documents_path = '/var/www/error'
223
+ $scriptalias = '/var/www/cgi-bin'
224
+ $access_log_file = 'access_log'
225
+ } elsif $::osfamily == 'debian' {
226
+ $docroot = '/var/www'
227
+ $pidfile = '${APACHE_PID_FILE}'
228
+ $error_log = 'error.log'
229
+ $error_documents_path = '/usr/share/apache2/error'
230
+ $scriptalias = '/usr/lib/cgi-bin'
231
+ $access_log_file = 'access.log'
232
+ } elsif $::osfamily == 'freebsd' {
233
+ $docroot = '/usr/local/www/apache22/data'
234
+ $pidfile = '/var/run/httpd.pid'
235
+ $error_log = 'httpd-error.log'
236
+ $error_documents_path = '/usr/local/www/apache22/error'
237
+ $scriptalias = '/usr/local/www/apache22/cgi-bin'
238
+ $access_log_file = 'httpd-access.log'
239
+ } else {
240
+ fail("Unsupported osfamily ${::osfamily}")
241
+ }
242
+
243
+ $apxs_workaround = $::osfamily ? {
244
+ 'freebsd' => true,
245
+ default => false
246
+ }
247
+
248
+ # Template uses:
249
+ # - $pidfile
250
+ # - $user
251
+ # - $group
252
+ # - $logroot
253
+ # - $error_log
254
+ # - $sendfile
255
+ # - $mod_dir
256
+ # - $ports_file
257
+ # - $confd_dir
258
+ # - $vhost_dir
259
+ # - $error_documents
260
+ # - $error_documents_path
261
+ # - $apxs_workaround
262
+ # - $keepalive
263
+ # - $keepalive_timeout
264
+ # - $server_root
265
+ # - $server_tokens
266
+ # - $server_signature
267
+ # - $trace_enable
268
+ file { "${apache::params::conf_dir}/${apache::params::conf_file}":
269
+ ensure => file,
270
+ content => template($conf_template),
271
+ notify => Class['Apache::Service'],
272
+ require => Package['httpd'],
273
+ }
274
+
275
+ # preserve back-wards compatibility to the times when default_mods was
276
+ # only a boolean value. Now it can be an array (too)
277
+ if is_array($default_mods) {
278
+ class { 'apache::default_mods':
279
+ all => false,
280
+ mods => $default_mods,
281
+ }
282
+ } else {
283
+ class { 'apache::default_mods':
284
+ all => $default_mods,
285
+ }
286
+ }
287
+ class { 'apache::default_confd_files':
288
+ all => $default_confd_files
289
+ }
290
+ if $mpm_module {
291
+ class { "apache::mod::${mpm_module}": }
292
+ }
293
+
294
+ $default_vhost_ensure = $default_vhost ? {
295
+ true => 'present',
296
+ false => 'absent'
297
+ }
298
+ $default_ssl_vhost_ensure = $default_ssl_vhost ? {
299
+ true => 'present',
300
+ false => 'absent'
301
+ }
302
+
303
+ apache::vhost { 'default':
304
+ ensure => $default_vhost_ensure,
305
+ port => 80,
306
+ docroot => $docroot,
307
+ scriptalias => $scriptalias,
308
+ serveradmin => $serveradmin,
309
+ access_log_file => $access_log_file,
310
+ priority => '15',
311
+ ip => $ip,
312
+ }
313
+ $ssl_access_log_file = $::osfamily ? {
314
+ 'freebsd' => $access_log_file,
315
+ default => "ssl_${access_log_file}",
316
+ }
317
+ apache::vhost { 'default-ssl':
318
+ ensure => $default_ssl_vhost_ensure,
319
+ port => 443,
320
+ ssl => true,
321
+ docroot => $docroot,
322
+ scriptalias => $scriptalias,
323
+ serveradmin => $serveradmin,
324
+ access_log_file => $ssl_access_log_file,
325
+ priority => '15',
326
+ ip => $ip,
327
+ }
328
+ }
329
+ }
@@ -0,0 +1,9 @@
1
+ define apache::listen {
2
+ $listen_addr_port = $name
3
+
4
+ # Template uses: $listen_addr_port
5
+ concat::fragment { "Listen ${listen_addr_port}":
6
+ target => $apache::ports_file,
7
+ content => template('apache/listen.erb'),
8
+ }
9
+ }
@@ -0,0 +1,17 @@
1
+ class apache::mod::alias {
2
+ $icons_path = $::osfamily ? {
3
+ 'debian' => '/usr/share/apache2/icons',
4
+ 'redhat' => '/var/www/icons',
5
+ 'freebsd' => '/usr/local/www/apache22/icons',
6
+ }
7
+ apache::mod { 'alias': }
8
+ # Template uses $icons_path
9
+ file { 'alias.conf':
10
+ ensure => file,
11
+ path => "${apache::mod_dir}/alias.conf",
12
+ content => template('apache/mod/alias.conf.erb'),
13
+ require => Exec["mkdir ${apache::mod_dir}"],
14
+ before => File[$apache::mod_dir],
15
+ notify => Service['httpd'],
16
+ }
17
+ }
@@ -0,0 +1,3 @@
1
+ class apache::mod::auth_basic {
2
+ apache::mod { 'auth_basic': }
3
+ }
@@ -0,0 +1,5 @@
1
+ class apache::mod::auth_kerb {
2
+ apache::mod { 'auth_kerb': }
3
+ }
4
+
5
+
@@ -0,0 +1,19 @@
1
+ class apache::mod::authnz_ldap (
2
+ $verifyServerCert = true,
3
+ ) {
4
+ include 'apache::mod::ldap'
5
+ apache::mod { 'authnz_ldap': }
6
+
7
+ validate_bool($verifyServerCert)
8
+
9
+ # Template uses:
10
+ # - $verifyServerCert
11
+ file { 'authnz_ldap.conf':
12
+ ensure => file,
13
+ path => "${apache::mod_dir}/authnz_ldap.conf",
14
+ content => template('apache/mod/authnz_ldap.conf.erb'),
15
+ require => Exec["mkdir ${apache::mod_dir}"],
16
+ before => File[$apache::mod_dir],
17
+ notify => Service['httpd'],
18
+ }
19
+ }
@@ -0,0 +1,12 @@
1
+ class apache::mod::autoindex {
2
+ apache::mod { 'autoindex': }
3
+ # Template uses no variables
4
+ file { 'autoindex.conf':
5
+ ensure => file,
6
+ path => "${apache::mod_dir}/autoindex.conf",
7
+ content => template('apache/mod/autoindex.conf.erb'),
8
+ require => Exec["mkdir ${apache::mod_dir}"],
9
+ before => File[$apache::mod_dir],
10
+ notify => Service['httpd'],
11
+ }
12
+ }
@@ -0,0 +1,3 @@
1
+ class apache::mod::cache {
2
+ apache::mod { 'cache': }
3
+ }
@@ -0,0 +1,4 @@
1
+ class apache::mod::cgi {
2
+ Class['apache::mod::prefork'] -> Class['apache::mod::cgi']
3
+ apache::mod { 'cgi': }
4
+ }
@@ -0,0 +1,23 @@
1
+ class apache::mod::cgid {
2
+ Class['apache::mod::worker'] -> Class['apache::mod::cgid']
3
+
4
+ # Debian specifies it's cgid sock path, but RedHat uses the default value
5
+ # with no config file
6
+ $cgisock_path = $::osfamily ? {
7
+ 'debian' => '${APACHE_RUN_DIR}/cgisock',
8
+ 'freebsd' => 'cgisock',
9
+ default => undef,
10
+ }
11
+ apache::mod { 'cgid': }
12
+ if $cgisock_path {
13
+ # Template uses $cgisock_path
14
+ file { 'cgid.conf':
15
+ ensure => file,
16
+ path => "${apache::mod_dir}/cgid.conf",
17
+ content => template('apache/mod/cgid.conf.erb'),
18
+ require => Exec["mkdir ${apache::mod_dir}"],
19
+ before => File[$apache::mod_dir],
20
+ notify => Service['httpd'],
21
+ }
22
+ }
23
+ }
@@ -0,0 +1,3 @@
1
+ class apache::mod::dav {
2
+ apache::mod { 'dav': }
3
+ }
@@ -0,0 +1,20 @@
1
+ class apache::mod::dav_fs {
2
+ $dav_lock = $::osfamily ? {
3
+ 'debian' => '${APACHE_LOCK_DIR}/DAVLock',
4
+ 'freebsd' => '/usr/local/var/DavLock',
5
+ default => '/var/lib/dav/lockdb',
6
+ }
7
+
8
+ Class['apache::mod::dav'] -> Class['apache::mod::dav_fs']
9
+ apache::mod { 'dav_fs': }
10
+
11
+ # Template uses: $dav_lock
12
+ file { 'dav_fs.conf':
13
+ ensure => file,
14
+ path => "${apache::mod_dir}/dav_fs.conf",
15
+ content => template('apache/mod/dav_fs.conf.erb'),
16
+ require => Exec["mkdir ${apache::mod_dir}"],
17
+ before => File[$apache::mod_dir],
18
+ notify => Service['httpd'],
19
+ }
20
+ }
@@ -0,0 +1,5 @@
1
+ class apache::mod::dav_svn {
2
+ Class['apache::mod::dav'] -> Class['apache::mod::dav_svn']
3
+ include apache::mod::dav
4
+ apache::mod { 'dav_svn': }
5
+ }
@@ -0,0 +1,12 @@
1
+ class apache::mod::deflate {
2
+ apache::mod { 'deflate': }
3
+ # Template uses no variables
4
+ file { 'deflate.conf':
5
+ ensure => file,
6
+ path => "${apache::mod_dir}/deflate.conf",
7
+ content => template('apache/mod/deflate.conf.erb'),
8
+ require => Exec["mkdir ${apache::mod_dir}"],
9
+ before => File[$apache::mod_dir],
10
+ notify => Service['httpd'],
11
+ }
12
+ }
@@ -0,0 +1,5 @@
1
+ class apache::mod::dev {
2
+ # Development packages are not apache modules
3
+ warning('apache::mod::dev is deprecated; please use apache::dev')
4
+ include apache::dev
5
+ }
@@ -0,0 +1,21 @@
1
+ # Note: this sets the global DirectoryIndex directive, it may be necessary to consider being able to modify the apache::vhost to declare DirectoryIndex statements in a vhost configuration
2
+ # Parameters:
3
+ # - $indexes provides a string for the DirectoryIndex directive http://httpd.apache.org/docs/current/mod/mod_dir.html#directoryindex
4
+ class apache::mod::dir (
5
+ $dir = 'public_html',
6
+ $indexes = ['index.html','index.html.var','index.cgi','index.pl','index.php','index.xhtml'],
7
+ ) {
8
+ validate_array($indexes)
9
+ apache::mod { 'dir': }
10
+
11
+ # Template uses
12
+ # - $indexes
13
+ file { 'dir.conf':
14
+ ensure => file,
15
+ path => "${apache::mod_dir}/dir.conf",
16
+ content => template('apache/mod/dir.conf.erb'),
17
+ require => Exec["mkdir ${apache::mod_dir}"],
18
+ before => File[$apache::mod_dir],
19
+ notify => Service['httpd'],
20
+ }
21
+ }
@@ -0,0 +1,24 @@
1
+ class apache::mod::disk_cache {
2
+ $cache_root = $::osfamily ? {
3
+ 'debian' => '/var/cache/apache2/mod_disk_cache',
4
+ 'redhat' => '/var/cache/mod_proxy',
5
+ 'freebsd' => '/var/cache/mod_disk_cache',
6
+ }
7
+ if $::osfamily != 'FreeBSD' {
8
+ # FIXME: investigate why disk_cache was dependent on proxy
9
+ # NOTE: on FreeBSD disk_cache is compiled by default but proxy is not
10
+ Class['apache::mod::proxy'] -> Class['apache::mod::disk_cache']
11
+ }
12
+ Class['apache::mod::cache'] -> Class['apache::mod::disk_cache']
13
+
14
+ apache::mod { 'disk_cache': }
15
+ # Template uses $cache_proxy
16
+ file { 'disk_cache.conf':
17
+ ensure => file,
18
+ path => "${apache::mod_dir}/disk_cache.conf",
19
+ content => template('apache/mod/disk_cache.conf.erb'),
20
+ require => Exec["mkdir ${apache::mod_dir}"],
21
+ before => File[$apache::mod_dir],
22
+ notify => Service['httpd'],
23
+ }
24
+ }
@@ -0,0 +1,54 @@
1
+ class apache::mod::event (
2
+ $startservers = '2',
3
+ $maxclients = '150',
4
+ $minsparethreads = '25',
5
+ $maxsparethreads = '75',
6
+ $threadsperchild = '25',
7
+ $maxrequestsperchild = '0',
8
+ $serverlimit = '25',
9
+ ) {
10
+ if defined(Class['apache::mod::itk']) {
11
+ fail('May not include both apache::mod::event and apache::mod::itk on the same node')
12
+ }
13
+ if defined(Class['apache::mod::peruser']) {
14
+ fail('May not include both apache::mod::event and apache::mod::peruser on the same node')
15
+ }
16
+ if defined(Class['apache::mod::prefork']) {
17
+ fail('May not include both apache::mod::event and apache::mod::prefork on the same node')
18
+ }
19
+ if defined(Class['apache::mod::worker']) {
20
+ fail('May not include both apache::mod::event and apache::mod::worker on the same node')
21
+ }
22
+ File {
23
+ owner => 'root',
24
+ group => $apache::params::root_group,
25
+ mode => '0644',
26
+ }
27
+
28
+ # Template uses:
29
+ # - $startservers
30
+ # - $maxclients
31
+ # - $minsparethreads
32
+ # - $maxsparethreads
33
+ # - $threadsperchild
34
+ # - $maxrequestsperchild
35
+ # - $serverlimit
36
+ file { "${apache::mod_dir}/event.conf":
37
+ ensure => file,
38
+ content => template('apache/mod/event.conf.erb'),
39
+ require => Exec["mkdir ${apache::mod_dir}"],
40
+ before => File[$apache::mod_dir],
41
+ notify => Service['httpd'],
42
+ }
43
+
44
+ case $::osfamily {
45
+ 'freebsd' : {
46
+ class { 'apache::package':
47
+ mpm_module => 'event'
48
+ }
49
+ }
50
+ default: {
51
+ fail("Unsupported osfamily ${::osfamily}")
52
+ }
53
+ }
54
+ }
@@ -0,0 +1,3 @@
1
+ class apache::mod::expires {
2
+ apache::mod { 'expires': }
3
+ }
@@ -0,0 +1,24 @@
1
+ class apache::mod::fastcgi {
2
+
3
+ # Debian specifies it's fastcgi lib path, but RedHat uses the default value
4
+ # with no config file
5
+ $fastcgi_lib_path = $apache::params::fastcgi_lib_path
6
+
7
+ apache::mod { 'fastcgi': }
8
+
9
+ if $fastcgi_lib_path {
10
+ # Template uses:
11
+ # - $fastcgi_server
12
+ # - $fastcgi_socket
13
+ # - $fastcgi_dir
14
+ file { 'fastcgi.conf':
15
+ ensure => file,
16
+ path => "${apache::mod_dir}/fastcgi.conf",
17
+ content => template('apache/mod/fastcgi.conf.erb'),
18
+ require => Exec["mkdir ${apache::mod_dir}"],
19
+ before => File[$apache::mod_dir],
20
+ notify => Service['httpd'],
21
+ }
22
+ }
23
+
24
+ }
@@ -0,0 +1,3 @@
1
+ class apache::mod::fcgid {
2
+ apache::mod { 'fcgid': }
3
+ }
@@ -0,0 +1,3 @@
1
+ class apache::mod::headers {
2
+ apache::mod { 'headers': }
3
+ }
@@ -0,0 +1,3 @@
1
+ class apache::mod::include {
2
+ apache::mod { 'include': }
3
+ }
@@ -0,0 +1,14 @@
1
+ class apache::mod::info (
2
+ $allow_from = ['127.0.0.1','::1'],
3
+ ){
4
+ apache::mod { 'info': }
5
+ # Template uses $allow_from
6
+ file { 'info.conf':
7
+ ensure => file,
8
+ path => "${apache::mod_dir}/info.conf",
9
+ content => template('apache/mod/info.conf.erb'),
10
+ require => Exec["mkdir ${apache::mod_dir}"],
11
+ before => File[$apache::mod_dir],
12
+ notify => Service['httpd'],
13
+ }
14
+ }