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,35 @@
1
+ require 'spec_helper_acceptance'
2
+
3
+ case fact('osfamily')
4
+ when 'Debian'
5
+ service_name = 'apache2'
6
+ when 'FreeBSD'
7
+ service_name = 'apache22'
8
+ else
9
+ # Not implemented yet
10
+ service_name = :skip
11
+ end
12
+
13
+ unless service_name.equal? :skip
14
+ describe 'apache::mod::itk class' do
15
+ describe 'running puppet code' do
16
+ # Using puppet_apply as a helper
17
+ it 'should work with no errors' do
18
+ pp = <<-EOS
19
+ class { 'apache':
20
+ mpm_module => 'itk',
21
+ }
22
+ EOS
23
+
24
+ # Run it twice and test for idempotency
25
+ apply_manifest(pp, :catch_failures => true)
26
+ expect(apply_manifest(pp, :catch_failures => true).exit_code).to be_zero
27
+ end
28
+ end
29
+
30
+ describe service(service_name) do
31
+ it { should be_running }
32
+ it { should be_enabled }
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,52 @@
1
+ require 'spec_helper_acceptance'
2
+
3
+ describe 'apache::mod::php class' do
4
+ case fact('osfamily')
5
+ when 'Debian'
6
+ mod_dir = '/etc/apache2/mods-available'
7
+ service_name = 'apache2'
8
+ when 'RedHat'
9
+ mod_dir = '/etc/httpd/conf.d'
10
+ service_name = 'httpd'
11
+ when 'FreeBSD'
12
+ mod_dir = '/usr/local/etc/apache22/Modules'
13
+ service_name = 'apache22'
14
+ end
15
+
16
+ context "default php config" do
17
+ it 'succeeds in puppeting php' do
18
+ pp= <<-EOS
19
+ class { 'apache':
20
+ mpm_module => 'prefork',
21
+ }
22
+ class { 'apache::mod::php': }
23
+ apache::vhost { 'php.example.com':
24
+ port => '80',
25
+ docroot => '/var/www/php',
26
+ }
27
+ host { 'php.example.com': ip => '127.0.0.1', }
28
+ file { '/var/www/php/index.php':
29
+ ensure => file,
30
+ content => "<?php phpinfo(); ?>\\n",
31
+ }
32
+ EOS
33
+ apply_manifest(pp, :catch_failures => true)
34
+ end
35
+
36
+ describe service(service_name) do
37
+ it { should be_enabled }
38
+ it { should be_running }
39
+ end
40
+
41
+ describe file("#{mod_dir}/php5.conf") do
42
+ it { should contain "DirectoryIndex index.php" }
43
+ end
44
+
45
+ it 'should answer to php.example.com' do
46
+ shell("/usr/bin/curl php.example.com:80") do |r|
47
+ r.stdout.should =~ /PHP Version/
48
+ r.exit_code.should == 0
49
+ end
50
+ end
51
+ end
52
+ end
@@ -0,0 +1,44 @@
1
+ require 'spec_helper_acceptance'
2
+
3
+ describe 'apache::mod::suphp class' do
4
+ case fact('osfamily')
5
+ when 'Debian'
6
+ context "default suphp config" do
7
+ it 'succeeds in puppeting suphp' do
8
+ pp = <<-EOS
9
+ class { 'apache':
10
+ mpm_module => 'prefork',
11
+ }
12
+ class { 'apache::mod::php': }
13
+ class { 'apache::mod::suphp': }
14
+ apache::vhost { 'suphp.example.com':
15
+ port => '80',
16
+ docroot => '/var/www/suphp',
17
+ }
18
+ host { 'suphp.example.com': ip => '127.0.0.1', }
19
+ file { '/var/www/suphp/index.php':
20
+ ensure => file,
21
+ owner => 'puppet',
22
+ group => 'puppet',
23
+ content => "<?php echo get_current_user(); ?>\\n",
24
+ }
25
+ EOS
26
+ apply_manifest(pp, :catch_failures => true)
27
+ end
28
+
29
+ describe service('apache2') do
30
+ it { should be_enabled }
31
+ it { should be_running }
32
+ end
33
+
34
+ it 'should answer to suphp.example.com' do
35
+ shell("/usr/bin/curl suphp.example.com:80") do |r|
36
+ r.stdout.should =~ /^puppet$/
37
+ r.exit_code.should == 0
38
+ end
39
+ end
40
+ end
41
+ when 'RedHat'
42
+ # Not implemented yet
43
+ end
44
+ end
@@ -0,0 +1,8 @@
1
+ HOSTS:
2
+ centos-64-x64:
3
+ roles:
4
+ - master
5
+ platform: el-6-i386
6
+ box : centos-64-x64-vbox4210-nocm
7
+ box_url : http://puppet-vagrant-boxes.puppetlabs.com/centos-64-x64-vbox4210-nocm.box
8
+ hypervisor : vagrant
@@ -0,0 +1,8 @@
1
+ HOSTS:
2
+ centos-64-x64:
3
+ roles:
4
+ - master
5
+ platform: el-6-i386
6
+ box : centos-64-x64-vbox4210-nocm
7
+ box_url : http://puppet-vagrant-boxes.puppetlabs.com/centos-64-x64-vbox4210-nocm.box
8
+ hypervisor : vagrant
@@ -0,0 +1,8 @@
1
+ HOSTS:
2
+ ubuntu-server-12042-x64:
3
+ roles:
4
+ - master
5
+ platform: ubuntu-server-12.04-amd64
6
+ box : ubuntu-server-12042-x64-vbox4210-nocm
7
+ box_url : http://puppet-vagrant-boxes.puppetlabs.com/ubuntu-server-12042-x64-vbox4210-nocm.box
8
+ hypervisor : vagrant
@@ -0,0 +1,27 @@
1
+ -----BEGIN RSA PRIVATE KEY-----
2
+ MIIEogIBAAKCAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzI
3
+ w+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoP
4
+ kcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2
5
+ hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NO
6
+ Td0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcW
7
+ yLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQIBIwKCAQEA4iqWPJXtzZA68mKd
8
+ ELs4jJsdyky+ewdZeNds5tjcnHU5zUYE25K+ffJED9qUWICcLZDc81TGWjHyAqD1
9
+ Bw7XpgUwFgeUJwUlzQurAv+/ySnxiwuaGJfhFM1CaQHzfXphgVml+fZUvnJUTvzf
10
+ TK2Lg6EdbUE9TarUlBf/xPfuEhMSlIE5keb/Zz3/LUlRg8yDqz5w+QWVJ4utnKnK
11
+ iqwZN0mwpwU7YSyJhlT4YV1F3n4YjLswM5wJs2oqm0jssQu/BT0tyEXNDYBLEF4A
12
+ sClaWuSJ2kjq7KhrrYXzagqhnSei9ODYFShJu8UWVec3Ihb5ZXlzO6vdNQ1J9Xsf
13
+ 4m+2ywKBgQD6qFxx/Rv9CNN96l/4rb14HKirC2o/orApiHmHDsURs5rUKDx0f9iP
14
+ cXN7S1uePXuJRK/5hsubaOCx3Owd2u9gD6Oq0CsMkE4CUSiJcYrMANtx54cGH7Rk
15
+ EjFZxK8xAv1ldELEyxrFqkbE4BKd8QOt414qjvTGyAK+OLD3M2QdCQKBgQDtx8pN
16
+ CAxR7yhHbIWT1AH66+XWN8bXq7l3RO/ukeaci98JfkbkxURZhtxV/HHuvUhnPLdX
17
+ 3TwygPBYZFNo4pzVEhzWoTtnEtrFueKxyc3+LjZpuo+mBlQ6ORtfgkr9gBVphXZG
18
+ YEzkCD3lVdl8L4cw9BVpKrJCs1c5taGjDgdInQKBgHm/fVvv96bJxc9x1tffXAcj
19
+ 3OVdUN0UgXNCSaf/3A/phbeBQe9xS+3mpc4r6qvx+iy69mNBeNZ0xOitIjpjBo2+
20
+ dBEjSBwLk5q5tJqHmy/jKMJL4n9ROlx93XS+njxgibTvU6Fp9w+NOFD/HvxB3Tcz
21
+ 6+jJF85D5BNAG3DBMKBjAoGBAOAxZvgsKN+JuENXsST7F89Tck2iTcQIT8g5rwWC
22
+ P9Vt74yboe2kDT531w8+egz7nAmRBKNM751U/95P9t88EDacDI/Z2OwnuFQHCPDF
23
+ llYOUI+SpLJ6/vURRbHSnnn8a/XG+nzedGH5JGqEJNQsz+xT2axM0/W/CRknmGaJ
24
+ kda/AoGANWrLCz708y7VYgAtW2Uf1DPOIYMdvo6fxIB5i9ZfISgcJ/bbCUkFrhoH
25
+ +vq/5CIWxCPp0f85R4qxxQ5ihxJ0YDQT9Jpx4TMss4PSavPaBH3RXow5Ohe+bYoQ
26
+ NE5OgEXk2wVfZczCZpigBKbKZHNYcelXtTt/nP3rsCuGcM4h53s=
27
+ -----END RSA PRIVATE KEY-----
@@ -0,0 +1,81 @@
1
+ require 'spec_helper_acceptance'
2
+
3
+ case fact('osfamily')
4
+ when 'RedHat'
5
+ servicename = 'httpd'
6
+ when 'Debian'
7
+ servicename = 'apache2'
8
+ when 'FreeBSD'
9
+ servicename = 'apache22'
10
+ else
11
+ raise "Unconfigured OS for apache service on #{fact('osfamily')}"
12
+ end
13
+
14
+ case fact('osfamily')
15
+ when 'FreeBSD'
16
+ describe 'apache::mod::event class' do
17
+ describe 'running puppet code' do
18
+ # Using puppet_apply as a helper
19
+ it 'should work with no errors' do
20
+ pp = <<-EOS
21
+ class { 'apache':
22
+ mpm_module => 'event',
23
+ }
24
+ EOS
25
+
26
+ # Run it twice and test for idempotency
27
+ apply_manifest(pp, :catch_failures => true)
28
+ expect(apply_manifest(pp, :catch_failures => true).exit_code).to be_zero
29
+ end
30
+ end
31
+
32
+ describe service(servicename) do
33
+ it { should be_running }
34
+ it { should be_enabled }
35
+ end
36
+ end
37
+ end
38
+
39
+ describe 'apache::mod::worker class' do
40
+ describe 'running puppet code' do
41
+ # Using puppet_apply as a helper
42
+ it 'should work with no errors' do
43
+ pp = <<-EOS
44
+ class { 'apache':
45
+ mpm_module => 'worker',
46
+ }
47
+ EOS
48
+
49
+ # Run it twice and test for idempotency
50
+ apply_manifest(pp, :catch_failures => true)
51
+ expect(apply_manifest(pp, :catch_failures => true).exit_code).to be_zero
52
+ end
53
+ end
54
+
55
+ describe service(servicename) do
56
+ it { should be_running }
57
+ it { should be_enabled }
58
+ end
59
+ end
60
+
61
+ describe 'apache::mod::prefork class' do
62
+ describe 'running puppet code' do
63
+ # Using puppet_apply as a helper
64
+ it 'should work with no errors' do
65
+ pp = <<-EOS
66
+ class { 'apache':
67
+ mpm_module => 'prefork',
68
+ }
69
+ EOS
70
+
71
+ # Run it twice and test for idempotency
72
+ apply_manifest(pp, :catch_failures => true)
73
+ expect(apply_manifest(pp, :catch_failures => true).exit_code).to be_zero
74
+ end
75
+ end
76
+
77
+ describe service(servicename) do
78
+ it { should be_running }
79
+ it { should be_enabled }
80
+ end
81
+ end
@@ -0,0 +1,19 @@
1
+ require 'spec_helper_acceptance'
2
+
3
+ describe 'apache::service class' do
4
+ describe 'adding dependencies in between the base class and service class' do
5
+ it 'should work with no errors' do
6
+ pp = <<-EOS
7
+ class { 'apache': }
8
+ file { '/tmp/test':
9
+ require => Class['apache'],
10
+ notify => Class['apache::service'],
11
+ }
12
+ EOS
13
+
14
+ # Run it twice and test for idempotency
15
+ apply_manifest(pp, :catch_failures => true)
16
+ expect(apply_manifest(pp, :catch_failures => true).exit_code).to be_zero
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,290 @@
1
+ require 'spec_helper_acceptance'
2
+
3
+ describe 'apache::vhost define' do
4
+ case fact('osfamily')
5
+ when 'RedHat'
6
+ vhost_dir = '/etc/httpd/conf.d'
7
+ package_name = 'httpd'
8
+ service_name = 'httpd'
9
+ when 'FreeBSD'
10
+ vhost_dir = '/usr/local/etc/apache22/Vhosts'
11
+ package_name = 'apache22'
12
+ service_name = 'apache22'
13
+ when 'Debian'
14
+ vhost_dir = '/etc/apache2/sites-enabled'
15
+ package_name = 'apache2'
16
+ service_name = 'apache2'
17
+ end
18
+
19
+ context "default vhost without ssl" do
20
+ it 'should create a default vhost config' do
21
+ pp = <<-EOS
22
+ class { 'apache': }
23
+ EOS
24
+
25
+ apply_manifest(pp, :catch_failures => true)
26
+ end
27
+
28
+ describe file("#{vhost_dir}/15-default.conf") do
29
+ it { should contain '<VirtualHost \*:80>' }
30
+ end
31
+
32
+ describe file("#{vhost_dir}/15-default-ssl.conf") do
33
+ it { should_not be_file }
34
+ end
35
+ end
36
+
37
+ context 'default vhost with ssl' do
38
+ it 'should create default vhost configs' do
39
+ pp = <<-EOS
40
+ class { 'apache':
41
+ default_ssl_vhost => true,
42
+ }
43
+ EOS
44
+ apply_manifest(pp, :catch_failures => true)
45
+ end
46
+
47
+ describe file("#{vhost_dir}/15-default.conf") do
48
+ it { should contain '<VirtualHost \*:80>' }
49
+ end
50
+
51
+ describe file("#{vhost_dir}/15-default-ssl.conf") do
52
+ it { should contain '<VirtualHost \*:443>' }
53
+ it { should contain "SSLEngine on" }
54
+ end
55
+ end
56
+
57
+ context 'new vhost on port 80' do
58
+ it 'should configure an apache vhost' do
59
+ pp = <<-EOS
60
+ class { 'apache': }
61
+ apache::vhost { 'first.example.com':
62
+ port => '80',
63
+ docroot => '/var/www/first',
64
+ }
65
+ EOS
66
+ apply_manifest(pp, :catch_failures => true)
67
+ end
68
+
69
+ describe file("#{vhost_dir}/25-first.example.com.conf") do
70
+ it { should contain '<VirtualHost \*:80>' }
71
+ it { should contain "ServerName first.example.com" }
72
+ end
73
+ end
74
+
75
+ context 'new proxy vhost on port 80' do
76
+ it 'should configure an apache proxy vhost' do
77
+ pp = <<-EOS
78
+ class { 'apache': }
79
+ apache::vhost { 'proxy.example.com':
80
+ port => '80',
81
+ docroot => '/var/www/proxy',
82
+ proxy_pass => [
83
+ { 'path' => '/foo', 'url' => 'http://backend-foo/'},
84
+ ],
85
+ }
86
+ EOS
87
+ apply_manifest(pp, :catch_failures => true)
88
+ end
89
+
90
+ describe file("#{vhost_dir}/25-proxy.example.com.conf") do
91
+ it { should contain '<VirtualHost \*:80>' }
92
+ it { should contain "ServerName proxy.example.com" }
93
+ it { should contain "ProxyPass" }
94
+ it { should_not contain "<Proxy \*>" }
95
+ end
96
+ end
97
+
98
+ context 'new vhost on port 80' do
99
+ it 'should configure two apache vhosts' do
100
+ pp = <<-EOS
101
+ class { 'apache': }
102
+ apache::vhost { 'first.example.com':
103
+ port => '80',
104
+ docroot => '/var/www/first',
105
+ }
106
+ host { 'first.example.com': ip => '127.0.0.1', }
107
+ file { '/var/www/first/index.html':
108
+ ensure => file,
109
+ content => "Hello from first\\n",
110
+ }
111
+ apache::vhost { 'second.example.com':
112
+ port => '80',
113
+ docroot => '/var/www/second',
114
+ }
115
+ host { 'second.example.com': ip => '127.0.0.1', }
116
+ file { '/var/www/second/index.html':
117
+ ensure => file,
118
+ content => "Hello from second\\n",
119
+ }
120
+ EOS
121
+ apply_manifest(pp, :catch_failures => true)
122
+ end
123
+
124
+ describe service(service_name) do
125
+ it { should be_enabled }
126
+ it { should be_running }
127
+ end
128
+
129
+ it 'should answer to first.example.com' do
130
+ shell("/usr/bin/curl first.example.com:80", {:acceptable_exit_codes => 0}) do |r|
131
+ r.stdout.should == "Hello from first\n"
132
+ end
133
+ end
134
+
135
+ it 'should answer to second.example.com' do
136
+ shell("/usr/bin/curl second.example.com:80", {:acceptable_exit_codes => 0}) do |r|
137
+ r.stdout.should == "Hello from second\n"
138
+ end
139
+ end
140
+ end
141
+
142
+ context 'apache_directories readme example, adapted' do
143
+ it 'should configure a vhost with Files' do
144
+ pp = <<-EOS
145
+ class { 'apache': }
146
+ apache::vhost { 'files.example.net':
147
+ docroot => '/var/www/files',
148
+ directories => [
149
+ { path => '~ (\.swp|\.bak|~)$', 'provider' => 'files', 'deny' => 'from all' },
150
+ ],
151
+ }
152
+ file { '/var/www/files/index.html.bak':
153
+ ensure => file,
154
+ content => "Hello World\\n",
155
+ }
156
+ host { 'files.example.net': ip => '127.0.0.1', }
157
+ EOS
158
+ apply_manifest(pp, :catch_failures => true)
159
+ end
160
+
161
+ describe service(service_name) do
162
+ it { should be_enabled }
163
+ it { should be_running }
164
+ end
165
+
166
+ it 'should answer to files.example.net' do
167
+ shell("/usr/bin/curl -sSf files.example.net:80/index.html.bak", {:acceptable_exit_codes => 22}).stderr.should =~ /curl: \(22\) The requested URL returned error: 403/
168
+ end
169
+
170
+ end
171
+
172
+ case fact('lsbdistcodename')
173
+ when 'precise', 'wheezy'
174
+ context 'vhost fallbackresouce example' do
175
+ it 'should configure a vhost with Fallbackresource' do
176
+ pp = <<-EOS
177
+ class { 'apache': }
178
+ apache::vhost { 'fallback.example.net':
179
+ docroot => '/var/www/fallback',
180
+ fallbackresource => '/index.html'
181
+ }
182
+ file { '/var/www/fallback/index.html':
183
+ ensure => file,
184
+ content => "Hello World\\n",
185
+ }
186
+ host { 'fallback.example.net': ip => '127.0.0.1', }
187
+ EOS
188
+ apply_manifest(pp, :catch_failures => true)
189
+ end
190
+
191
+ describe service(service_name) do
192
+ it { should be_enabled }
193
+ it { should be_running }
194
+ end
195
+
196
+ it 'should answer to fallback.example.net' do
197
+ shell("/usr/bin/curl fallback.example.net:80/Does/Not/Exist") do |r|
198
+ r.stdout.should == "Hello World\n"
199
+ end
200
+ end
201
+
202
+ end
203
+ else
204
+ # The current stable RHEL release (6.4) comes with Apache httpd 2.2.15
205
+ # That was released March 6, 2010.
206
+ # FallbackResource was backported to 2.2.16, and released July 25, 2010.
207
+ # Ubuntu Lucid (10.04) comes with apache2 2.2.14, released October 3, 2009.
208
+ # https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x/STATUS
209
+ end
210
+
211
+ context 'virtual_docroot hosting separate sites' do
212
+ it 'should configure a vhost with VirtualDocumentRoot' do
213
+ pp = <<-EOS
214
+ class { 'apache': }
215
+ apache::vhost { 'virt.example.com':
216
+ vhost_name => '*',
217
+ serveraliases => '*virt.example.com',
218
+ port => '80',
219
+ docroot => '/var/www/virt',
220
+ virtual_docroot => '/var/www/virt/%1',
221
+ }
222
+ host { 'virt.example.com': ip => '127.0.0.1', }
223
+ host { 'a.virt.example.com': ip => '127.0.0.1', }
224
+ host { 'b.virt.example.com': ip => '127.0.0.1', }
225
+ file { [ '/var/www/virt/a', '/var/www/virt/b', ]: ensure => directory, }
226
+ file { '/var/www/virt/a/index.html': ensure => file, content => "Hello from a.virt\\n", }
227
+ file { '/var/www/virt/b/index.html': ensure => file, content => "Hello from b.virt\\n", }
228
+ EOS
229
+ apply_manifest(pp, :catch_failures => true)
230
+ end
231
+
232
+ describe service(service_name) do
233
+ it { should be_enabled }
234
+ it { should be_running }
235
+ end
236
+
237
+ it 'should answer to a.virt.example.com' do
238
+ shell("/usr/bin/curl a.virt.example.com:80", {:acceptable_exit_codes => 0}) do |r|
239
+ r.stdout.should == "Hello from a.virt\n"
240
+ end
241
+ end
242
+
243
+ it 'should answer to b.virt.example.com' do
244
+ shell("/usr/bin/curl b.virt.example.com:80", {:acceptable_exit_codes => 0}) do |r|
245
+ r.stdout.should == "Hello from b.virt\n"
246
+ end
247
+ end
248
+ end
249
+
250
+ context 'proxy_pass for alternative vhost' do
251
+ it 'should configure a local vhost and a proxy vhost' do
252
+ apply_manifest(%{
253
+ class { 'apache': default_vhost => false, }
254
+ apache::vhost { 'localhost':
255
+ docroot => '/var/www/local',
256
+ ip => '127.0.0.1',
257
+ port => '8888',
258
+ }
259
+ apache::listen { '*:80': }
260
+ apache::vhost { 'proxy.example.com':
261
+ docroot => '/var/www',
262
+ port => '80',
263
+ add_listen => false,
264
+ proxy_pass => {
265
+ 'path' => '/',
266
+ 'url' => 'http://localhost:8888/subdir/',
267
+ },
268
+ }
269
+ host { 'proxy.example.com': ip => '127.0.0.1', }
270
+ file { ['/var/www/local', '/var/www/local/subdir']: ensure => directory, }
271
+ file { '/var/www/local/subdir/index.html':
272
+ ensure => file,
273
+ content => "Hello from localhost\\n",
274
+ }
275
+ }, :catch_failures => true)
276
+ end
277
+
278
+ describe service(service_name) do
279
+ it { should be_enabled }
280
+ it { should be_running }
281
+ end
282
+
283
+ it 'should get a response from the back end' do
284
+ shell("/usr/bin/curl --max-redirs 0 proxy.example.com:80") do |r|
285
+ r.stdout.should == "Hello from localhost\n"
286
+ r.exit_code.should == 0
287
+ end
288
+ end
289
+ end
290
+ end