Permalink
Browse files

Initial commit

  • Loading branch information...
mdxp committed Aug 15, 2012
1 parent d66a791 commit a1e925b449a1c5b1cb554e316b11f4c407f93397
Showing with 12,374 additions and 0 deletions.
  1. +21 −0 Vagrantfile
  2. +1 −0 bootstrap.sh
  3. +15 −0 chef.json
  4. +398 −0 cookbooks/apache2/README.md
  5. +139 −0 cookbooks/apache2/attributes/default.rb
  6. +32 −0 cookbooks/apache2/attributes/mod_auth_openid.rb
  7. +26 −0 cookbooks/apache2/definitions/apache_conf.rb
  8. +53 −0 cookbooks/apache2/definitions/apache_module.rb
  9. +43 −0 cookbooks/apache2/definitions/apache_site.rb
  10. +49 −0 cookbooks/apache2/definitions/web_app.rb
  11. +41 −0 cookbooks/apache2/files/default/apache2_module_conf_generate.pl
  12. +205 −0 cookbooks/apache2/metadata.rb
  13. +217 −0 cookbooks/apache2/recipes/default.rb
  14. +33 −0 cookbooks/apache2/recipes/god_monitor.rb
  15. +22 −0 cookbooks/apache2/recipes/mod_alias.rb
  16. +45 −0 cookbooks/apache2/recipes/mod_apreq2.rb
  17. +20 −0 cookbooks/apache2/recipes/mod_auth_basic.rb
  18. +20 −0 cookbooks/apache2/recipes/mod_auth_digest.rb
  19. +113 −0 cookbooks/apache2/recipes/mod_auth_openid.rb
  20. +20 −0 cookbooks/apache2/recipes/mod_authn_file.rb
  21. +20 −0 cookbooks/apache2/recipes/mod_authnz_ldap.rb
  22. +20 −0 cookbooks/apache2/recipes/mod_authz_default.rb
  23. +20 −0 cookbooks/apache2/recipes/mod_authz_groupfile.rb
  24. +20 −0 cookbooks/apache2/recipes/mod_authz_host.rb
  25. +20 −0 cookbooks/apache2/recipes/mod_authz_user.rb
  26. +22 −0 cookbooks/apache2/recipes/mod_autoindex.rb
  27. +20 −0 cookbooks/apache2/recipes/mod_cgi.rb
  28. +20 −0 cookbooks/apache2/recipes/mod_dav.rb
  29. +20 −0 cookbooks/apache2/recipes/mod_dav_fs.rb
  30. +29 −0 cookbooks/apache2/recipes/mod_dav_svn.rb
  31. +22 −0 cookbooks/apache2/recipes/mod_deflate.rb
  32. +22 −0 cookbooks/apache2/recipes/mod_dir.rb
  33. +20 −0 cookbooks/apache2/recipes/mod_env.rb
  34. +20 −0 cookbooks/apache2/recipes/mod_expires.rb
  35. +54 −0 cookbooks/apache2/recipes/mod_fcgid.rb
  36. +20 −0 cookbooks/apache2/recipes/mod_headers.rb
  37. +20 −0 cookbooks/apache2/recipes/mod_ldap.rb
  38. +24 −0 cookbooks/apache2/recipes/mod_log_config.rb
  39. +22 −0 cookbooks/apache2/recipes/mod_mime.rb
  40. +22 −0 cookbooks/apache2/recipes/mod_negotiation.rb
  41. +43 −0 cookbooks/apache2/recipes/mod_perl.rb
  42. +78 −0 cookbooks/apache2/recipes/mod_php5.rb
  43. +22 −0 cookbooks/apache2/recipes/mod_proxy.rb
  44. +20 −0 cookbooks/apache2/recipes/mod_proxy_ajp.rb
  45. +20 −0 cookbooks/apache2/recipes/mod_proxy_balancer.rb
  46. +20 −0 cookbooks/apache2/recipes/mod_proxy_connect.rb
  47. +20 −0 cookbooks/apache2/recipes/mod_proxy_http.rb
  48. +32 −0 cookbooks/apache2/recipes/mod_python.rb
  49. +20 −0 cookbooks/apache2/recipes/mod_rewrite.rb
  50. +22 −0 cookbooks/apache2/recipes/mod_setenvif.rb
  51. +43 −0 cookbooks/apache2/recipes/mod_ssl.rb
  52. +22 −0 cookbooks/apache2/recipes/mod_status.rb
  53. +27 −0 cookbooks/apache2/recipes/mod_wsgi.rb
  54. +27 −0 cookbooks/apache2/recipes/mod_xsendfile.rb
  55. +22 −0 cookbooks/apache2/templates/default/a2dismod.erb
  56. +29 −0 cookbooks/apache2/templates/default/a2dissite.erb
  57. +37 −0 cookbooks/apache2/templates/default/a2enmod.erb
  58. +38 −0 cookbooks/apache2/templates/default/a2ensite.erb
  59. +236 −0 cookbooks/apache2/templates/default/apache2.conf.erb
  60. +19 −0 cookbooks/apache2/templates/default/apache2.god.erb
  61. +6 −0 cookbooks/apache2/templates/default/charset.erb
  62. +57 −0 cookbooks/apache2/templates/default/default-site.erb
  63. +2 −0 cookbooks/apache2/templates/default/mods/README
  64. +24 −0 cookbooks/apache2/templates/default/mods/alias.conf.erb
  65. +1 −0 cookbooks/apache2/templates/default/mods/authopenid.load.erb
  66. +101 −0 cookbooks/apache2/templates/default/mods/autoindex.conf.erb
  67. +16 −0 cookbooks/apache2/templates/default/mods/deflate.conf.erb
  68. +5 −0 cookbooks/apache2/templates/default/mods/dir.conf.erb
  69. +10 −0 cookbooks/apache2/templates/default/mods/fcgid.conf.erb
  70. +198 −0 cookbooks/apache2/templates/default/mods/mime.conf.erb
  71. +18 −0 cookbooks/apache2/templates/default/mods/negotiation.conf.erb
  72. +16 −0 cookbooks/apache2/templates/default/mods/php5.conf.erb
  73. +19 −0 cookbooks/apache2/templates/default/mods/proxy.conf.erb
  74. +28 −0 cookbooks/apache2/templates/default/mods/setenvif.conf.erb
  75. +76 −0 cookbooks/apache2/templates/default/mods/ssl.conf.erb
  76. +16 −0 cookbooks/apache2/templates/default/mods/status.conf.erb
  77. +2 −0 cookbooks/apache2/templates/default/port_apache.erb
  78. +6 −0 cookbooks/apache2/templates/default/ports.conf.erb
  79. +50 −0 cookbooks/apache2/templates/default/security.erb
  80. +43 −0 cookbooks/apache2/templates/default/web_app.conf.erb
  81. +134 −0 cookbooks/apt/README.md
  82. +50 −0 cookbooks/apt/files/default/apt-proxy-v2.conf
  83. +13 −0 cookbooks/apt/metadata.rb
  84. +70 −0 cookbooks/apt/providers/repository.rb
  85. +55 −0 cookbooks/apt/recipes/cacher-client.rb
  86. +30 −0 cookbooks/apt/recipes/cacher-ng.rb
  87. +56 −0 cookbooks/apt/recipes/default.rb
  88. +35 −0 cookbooks/apt/resources/repository.rb
  89. +96 −0 cookbooks/bluepill/README.md
  90. +36 −0 cookbooks/bluepill/attributes/default.rb
  91. +7 −0 cookbooks/bluepill/metadata.rb
  92. +109 −0 cookbooks/bluepill/providers/service.rb
  93. +33 −0 cookbooks/bluepill/recipes/default.rb
  94. +26 −0 cookbooks/bluepill/resources/service.rb
  95. +31 −0 cookbooks/bluepill/templates/centos/bluepill_init.erb
  96. +31 −0 cookbooks/bluepill/templates/freebsd/bluepill_init.erb
  97. +24 −0 cookbooks/build-essential/README.md
  98. +10 −0 cookbooks/build-essential/metadata.rb
  99. +45 −0 cookbooks/build-essential/recipes/default.rb
  100. +294 −0 cookbooks/chef-client/README.md
  101. +70 −0 cookbooks/chef-client/attributes/default.rb
  102. +15 −0 cookbooks/chef-client/metadata.rb
  103. +53 −0 cookbooks/chef-client/recipes/config.rb
  104. +83 −0 cookbooks/chef-client/recipes/cron.rb
  105. +20 −0 cookbooks/chef-client/recipes/default.rb
  106. +26 −0 cookbooks/chef-client/recipes/delete_validation.rb
  107. +242 −0 cookbooks/chef-client/recipes/service.rb
  108. +5 −0 cookbooks/chef-client/templates/arch/conf.d/chef-client.conf.erb
  109. +76 −0 cookbooks/chef-client/templates/arch/rc.d/chef-client.erb
  110. +14 −0 cookbooks/chef-client/templates/default/chef-client.pill.erb
  111. +36 −0 cookbooks/chef-client/templates/default/client.rb.erb
  112. +4 −0 cookbooks/chef-client/templates/default/debian/default/chef-client.erb
  113. +185 −0 cookbooks/chef-client/templates/default/debian/init.d/chef-client.erb
  114. +17 −0 cookbooks/chef-client/templates/default/debian/init/chef-client.conf.erb
  115. +110 −0 cookbooks/chef-client/templates/default/redhat/init.d/chef-client.erb
  116. +15 −0 cookbooks/chef-client/templates/default/redhat/sysconfig/chef-client.erb
  117. +78 −0 cookbooks/chef-client/templates/default/solaris/chef-client.erb
  118. +103 −0 cookbooks/chef-client/templates/default/solaris/manifest.xml.erb
  119. +2 −0 cookbooks/chef-client/templates/default/sv-chef-client-log-run.erb
  120. +4 −0 cookbooks/chef-client/templates/default/sv-chef-client-run.erb
  121. +38 −0 cookbooks/chef-client/templates/windows/chef-client.xml.erb
  122. +358 −0 cookbooks/chef-server/README.md
  123. +55 −0 cookbooks/chef-server/attributes/default.rb
  124. +43 −0 cookbooks/chef-server/attributes/server_proxy.rb
  125. +18 −0 cookbooks/chef-server/metadata.rb
  126. +67 −0 cookbooks/chef-server/recipes/apache-proxy.rb
  127. +52 −0 cookbooks/chef-server/recipes/default.rb
  128. +61 −0 cookbooks/chef-server/recipes/nginx-proxy.rb
  129. +69 −0 cookbooks/chef-server/recipes/rabbitmq.rb
  130. +268 −0 cookbooks/chef-server/recipes/rubygems-install.rb
  131. +15 −0 cookbooks/chef-server/templates/default/chef-expander.pill.erb
  132. +15 −0 cookbooks/chef-server/templates/default/chef-server-webui.pill.erb
  133. +15 −0 cookbooks/chef-server/templates/default/chef-server.pill.erb
  134. +15 −0 cookbooks/chef-server/templates/default/chef-solr.pill.erb
  135. +71 −0 cookbooks/chef-server/templates/default/chef_server.conf.erb
  136. +86 −0 cookbooks/chef-server/templates/default/chef_server.nginx.conf.erb
  137. +34 −0 cookbooks/chef-server/templates/default/server.rb.erb
  138. +16 −0 cookbooks/chef-server/templates/default/solr.rb.erb
  139. +2 −0 cookbooks/chef-server/templates/default/sv-chef-expander-log-run.erb
  140. +4 −0 cookbooks/chef-server/templates/default/sv-chef-expander-run.erb
  141. +2 −0 cookbooks/chef-server/templates/default/sv-chef-server-log-run.erb
  142. +4 −0 cookbooks/chef-server/templates/default/sv-chef-server-run.erb
  143. +2 −0 cookbooks/chef-server/templates/default/sv-chef-server-webui-log-run.erb
  144. +4 −0 cookbooks/chef-server/templates/default/sv-chef-server-webui-run.erb
  145. +2 −0 cookbooks/chef-server/templates/default/sv-chef-solr-log-run.erb
  146. +4 −0 cookbooks/chef-server/templates/default/sv-chef-solr-run.erb
  147. +398 −0 cookbooks/chef/README.md
  148. +50 −0 cookbooks/chef/attributes/default.rb
  149. +29 −0 cookbooks/chef/attributes/server_proxy.rb
  150. +22 −0 cookbooks/chef/metadata.rb
  151. +22 −0 cookbooks/chef/recipes/bootstrap_client.rb
  152. +41 −0 cookbooks/chef/recipes/bootstrap_server.rb
  153. +37 −0 cookbooks/chef/recipes/client.rb
  154. +36 −0 cookbooks/chef/recipes/client_service.rb
  155. 0 cookbooks/chef/recipes/default.rb
  156. +23 −0 cookbooks/chef/recipes/delete_validation.rb
  157. +41 −0 cookbooks/chef/recipes/server.rb
  158. +41 −0 cookbooks/chef/recipes/server_proxy.rb
  159. +68 −0 cookbooks/couchdb/README.md
  160. +22 −0 cookbooks/couchdb/attributes/default.rb
  161. +168 −0 cookbooks/couchdb/files/default/couchdb.init
  162. +24 −0 cookbooks/couchdb/metadata.rb
  163. +64 −0 cookbooks/couchdb/recipes/default.rb
  164. +93 −0 cookbooks/couchdb/recipes/source.rb
  165. +2 −0 cookbooks/couchdb/templates/default/port_couchdb.erb
  166. +43 −0 cookbooks/daemontools/README.md
  167. +42 −0 cookbooks/daemontools/attributes/default.rb
  168. +36 −0 cookbooks/daemontools/files/arch/PKGBUILD
  169. +13 −0 cookbooks/daemontools/files/arch/daemontools-0.76.svscanboot-path-fix.patch
  170. +15 −0 cookbooks/daemontools/metadata.rb
  171. +191 −0 cookbooks/daemontools/providers/service.rb
  172. +70 −0 cookbooks/daemontools/recipes/default.rb
  173. +44 −0 cookbooks/daemontools/resources/service.rb
  174. +36 −0 cookbooks/erlang/README.md
  175. +1 −0 cookbooks/erlang/attributes/default.rb
  176. +12 −0 cookbooks/erlang/metadata.rb
  177. +39 −0 cookbooks/erlang/recipes/default.rb
  178. +1 −0 cookbooks/gecode
  179. +187 −0 cookbooks/java/README.md
  180. +52 −0 cookbooks/java/attributes/default.rb
  181. +16 −0 cookbooks/java/metadata.rb
  182. +158 −0 cookbooks/java/providers/ark.rb
  183. +21 −0 cookbooks/java/recipes/default.rb
  184. +83 −0 cookbooks/java/recipes/openjdk.rb
  185. +52 −0 cookbooks/java/recipes/oracle.rb
  186. +48 −0 cookbooks/java/recipes/oracle_i386.rb
  187. +37 −0 cookbooks/java/resources/ark.rb
  188. +91 −0 cookbooks/nginx/README.md
  189. +65 −0 cookbooks/nginx/attributes/default.rb
  190. +35 −0 cookbooks/nginx/definitions/nginx_site.rb
  191. +73 −0 cookbooks/nginx/files/default/mime.types
  192. +89 −0 cookbooks/nginx/metadata.rb
  193. +57 −0 cookbooks/nginx/recipes/default.rb
  194. +172 −0 cookbooks/nginx/recipes/source.rb
  195. +11 −0 cookbooks/nginx/templates/default/default-site.erb
  196. +42 −0 cookbooks/nginx/templates/default/nginx.conf.erb
  197. +92 −0 cookbooks/nginx/templates/default/nginx.init.erb
  198. +15 −0 cookbooks/nginx/templates/default/nginx.pill.erb
  199. +1 −0 cookbooks/nginx/templates/default/nginx.sysconfig.erb
  200. +29 −0 cookbooks/nginx/templates/default/nxdissite.erb
  201. +38 −0 cookbooks/nginx/templates/default/nxensite.erb
  202. +2 −0 cookbooks/nginx/templates/default/sv-nginx-log-run.erb
  203. +3 −0 cookbooks/nginx/templates/default/sv-nginx-run.erb
  204. +37 −0 cookbooks/openssl/README.md
  205. +37 −0 cookbooks/openssl/libraries/secure_password.rb
  206. +8 −0 cookbooks/openssl/metadata.rb
  207. +19 −0 cookbooks/openssl/recipes/default.rb
  208. +93 −0 cookbooks/rabbitmq/README.md
  209. +28 −0 cookbooks/rabbitmq/attributes/default.rb
  210. +65 −0 cookbooks/rabbitmq/metadata.rb
  211. +66 −0 cookbooks/rabbitmq/providers/user.rb
  212. +34 −0 cookbooks/rabbitmq/providers/vhost.rb
  213. +87 −0 cookbooks/rabbitmq/recipes/default.rb
  214. +25 −0 cookbooks/rabbitmq/resources/user.rb
  215. +22 −0 cookbooks/rabbitmq/resources/vhost.rb
  216. +1 −0 cookbooks/rabbitmq/templates/default/doterlang.cookie.erb
  217. +10 −0 cookbooks/rabbitmq/templates/default/rabbitmq-env.conf.erb
  218. +21 −0 cookbooks/rabbitmq/templates/default/rabbitmq.config.erb
  219. +236 −0 cookbooks/runit/README.md
  220. +31 −0 cookbooks/runit/attributes/default.rb
  221. +164 −0 cookbooks/runit/definitions/runit_service.rb
  222. +1 −0 cookbooks/runit/files/default/runit.seed
  223. 0 cookbooks/runit/files/default/runsvdir
  224. +6 −0 cookbooks/runit/files/ubuntu-6.10/runsvdir
  225. +7 −0 cookbooks/runit/files/ubuntu-7.04/runsvdir
  226. +7 −0 cookbooks/runit/files/ubuntu-7.10/runsvdir
  227. +7 −0 cookbooks/runit/files/ubuntu-8.04/runsvdir
  228. +37 −0 cookbooks/runit/metadata.rb
  229. +72 −0 cookbooks/runit/recipes/default.rb
  230. +32 −0 cookbooks/runit/templates/gentoo/runit-start.sh.erb
  231. +35 −0 cookbooks/ucspi-tcp/README.md
  232. +37 −0 cookbooks/ucspi-tcp/attributes/default.rb
  233. +16 −0 cookbooks/ucspi-tcp/metadata.rb
  234. +59 −0 cookbooks/ucspi-tcp/recipes/default.rb
  235. +35 −0 cookbooks/xml/README.md
  236. +12 −0 cookbooks/xml/metadata.rb
  237. +28 −0 cookbooks/xml/recipes/default.rb
  238. +153 −0 cookbooks/yum/README.md
  239. +33 −0 cookbooks/yum/attributes/default.rb
  240. +21 −0 cookbooks/yum/metadata.rb
  241. +74 −0 cookbooks/yum/providers/key.rb
  242. +65 −0 cookbooks/yum/providers/repository.rb
  243. +18 −0 cookbooks/yum/recipes/default.rb
  244. +41 −0 cookbooks/yum/recipes/epel.rb
  245. +40 −0 cookbooks/yum/recipes/ius.rb
  246. +23 −0 cookbooks/yum/recipes/yum.rb
  247. +23 −0 cookbooks/yum/resources/key.rb
  248. +31 −0 cookbooks/yum/resources/repository.rb
  249. +25 −0 cookbooks/yum/templates/default/repo.erb
  250. +28 −0 cookbooks/yum/templates/default/yum-rhel5.conf.erb
  251. +31 −0 cookbooks/yum/templates/default/yum-rhel6.conf.erb
  252. +27 −0 cookbooks/zlib/README.md
  253. +12 −0 cookbooks/zlib/metadata.rb
  254. +25 −0 cookbooks/zlib/recipes/default.rb
  255. +10 −0 ruby.sh
  256. +2 −0 solo.rb
View
@@ -0,0 +1,21 @@
+Vagrant::Config.run do |config|
+ config.vm.box_url = "http://vagrant-promet.s3.amazonaws.com/centos-63.box"
+ config.vm.box = "centos-63"
+ config.vm.host_name = "chefserver"
+
+ config.vm.customize ["modifyvm", :id, "--memory", "1024"]
+ config.vm.network :hostonly, "33.33.33.3"
+
+ config.vm.forward_port 4000, 4000
+ config.vm.forward_port 4040, 4040
+ config.vm.forward_port 443, 443
+
+ #config.vm.provision :chef_solo do |chef|
+ # chef.cookbooks_path = "cookbooks"
+ # chef.data_bags_path = "data_bags"
+ # chef.roles_path = "roles"
+ # chef.add_role("vagrant")
+ # chef.add_recipe "build-essential"
+ # chef.log_level = :debug
+ #end
+end
View
@@ -0,0 +1 @@
+chef-solo -c solo.rb -j chef.json
View
@@ -0,0 +1,15 @@
+{
+ "chef_server": {
+ "server_url": "http://localhost:4000",
+ "webui_enabled": true,
+ "workers": 8,
+ "init_style": "init"
+ },
+ "yum": {
+ "epel_release": "6-7"
+ },
+ "run_list": [
+ "recipe[chef-server::rubygems-install]",
+ "recipe[chef-server::nginx-proxy]"
+ ]
+}
View

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -0,0 +1,139 @@
+#
+# Cookbook Name:: apache2
+# Attributes:: apache
+#
+# Copyright 2008-2009, Opscode, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+set[:apache][:root_group] = "root"
+
+# Where the various parts of apache are
+case platform
+when "redhat","centos","scientific","fedora","suse"
+ set[:apache][:package] = "httpd"
+ set[:apache][:dir] = "/etc/httpd"
+ set[:apache][:log_dir] = "/var/log/httpd"
+ set[:apache][:error_log] = "error.log"
+ set[:apache][:user] = "apache"
+ set[:apache][:group] = "apache"
+ set[:apache][:binary] = "/usr/sbin/httpd"
+ set[:apache][:icondir] = "/var/www/icons"
+ set[:apache][:cache_dir] = "/var/cache/httpd"
+ if node.platform_version.to_f >= 6 then
+ set[:apache][:pid_file] = "/var/run/httpd/httpd.pid"
+ else
+ set[:apache][:pid_file] = "/var/run/httpd.pid"
+ end
+ set[:apache][:lib_dir] = node[:kernel][:machine] =~ /^i[36]86$/ ? "/usr/lib/httpd" : "/usr/lib64/httpd"
+ set[:apache][:libexecdir] = "#{set[:apache][:lib_dir]}/modules"
+when "debian","ubuntu"
+ set[:apache][:package] = "apache2"
+ set[:apache][:dir] = "/etc/apache2"
+ set[:apache][:log_dir] = "/var/log/apache2"
+ set[:apache][:error_log] = "error.log"
+ set[:apache][:user] = "www-data"
+ set[:apache][:group] = "www-data"
+ set[:apache][:binary] = "/usr/sbin/apache2"
+ set[:apache][:icondir] = "/usr/share/apache2/icons"
+ set[:apache][:cache_dir] = "/var/cache/apache2"
+ set[:apache][:pid_file] = "/var/run/apache2.pid"
+ set[:apache][:lib_dir] = "/usr/lib/apache2"
+ set[:apache][:libexecdir] = "#{set[:apache][:lib_dir]}/modules"
+when "arch"
+ set[:apache][:package] = "apache"
+ set[:apache][:dir] = "/etc/httpd"
+ set[:apache][:log_dir] = "/var/log/httpd"
+ set[:apache][:error_log] = "error.log"
+ set[:apache][:user] = "http"
+ set[:apache][:group] = "http"
+ set[:apache][:binary] = "/usr/sbin/httpd"
+ set[:apache][:icondir] = "/usr/share/httpd/icons"
+ set[:apache][:cache_dir] = "/var/cache/httpd"
+ set[:apache][:pid_file] = "/var/run/httpd/httpd.pid"
+ set[:apache][:lib_dir] = "/usr/lib/httpd"
+ set[:apache][:libexecdir] = "#{set[:apache][:lib_dir]}/modules"
+when "freebsd"
+ set[:apache][:package] = "apache22"
+ set[:apache][:dir] = "/usr/local/etc/apache22"
+ set[:apache][:log_dir] = "/var/log"
+ set[:apache][:error_log] = "httpd-error.log"
+ set[:apache][:root_group] = "wheel"
+ set[:apache][:user] = "www"
+ set[:apache][:group] = "www"
+ set[:apache][:binary] = "/usr/local/sbin/httpd"
+ set[:apache][:icondir] = "/usr/local/www/apache22/icons"
+ set[:apache][:cache_dir] = "/var/run/apache22"
+ set[:apache][:pid_file] = "/var/run/httpd.pid"
+ set[:apache][:lib_dir] = "/usr/local/libexec/apache22"
+ set[:apache][:libexecdir] = set[:apache][:lib_dir]
+else
+ set[:apache][:dir] = "/etc/apache2"
+ set[:apache][:log_dir] = "/var/log/apache2"
+ set[:apache][:error_log] = "error.log"
+ set[:apache][:user] = "www-data"
+ set[:apache][:group] = "www-data"
+ set[:apache][:binary] = "/usr/sbin/apache2"
+ set[:apache][:icondir] = "/usr/share/apache2/icons"
+ set[:apache][:cache_dir] = "/var/cache/apache2"
+ set[:apache][:pid_file] = "logs/httpd.pid"
+ set[:apache][:lib_dir] = "/usr/lib/apache2"
+ set[:apache][:libexecdir] = "#{set[:apache][:lib_dir]}/modules"
+end
+
+###
+# These settings need the unless, since we want them to be tunable,
+# and we don't want to override the tunings.
+###
+
+# General settings
+default[:apache][:listen_ports] = [ "80","443" ]
+default[:apache][:contact] = "ops@example.com"
+default[:apache][:timeout] = 300
+default[:apache][:keepalive] = "On"
+default[:apache][:keepaliverequests] = 100
+default[:apache][:keepalivetimeout] = 5
+
+# Security
+default[:apache][:servertokens] = "Prod"
+default[:apache][:serversignature] = "On"
+default[:apache][:traceenable] = "On"
+
+# mod_auth_openids
+default[:apache][:allowed_openids] = Array.new
+
+# Prefork Attributes
+default[:apache][:prefork][:startservers] = 16
+default[:apache][:prefork][:minspareservers] = 16
+default[:apache][:prefork][:maxspareservers] = 32
+default[:apache][:prefork][:serverlimit] = 400
+default[:apache][:prefork][:maxclients] = 400
+default[:apache][:prefork][:maxrequestsperchild] = 10000
+
+# Worker Attributes
+default[:apache][:worker][:startservers] = 4
+default[:apache][:worker][:maxclients] = 1024
+default[:apache][:worker][:minsparethreads] = 64
+default[:apache][:worker][:maxsparethreads] = 192
+default[:apache][:worker][:threadsperchild] = 64
+default[:apache][:worker][:maxrequestsperchild] = 0
+
+# Default modules to enable via include_recipe
+
+default['apache']['default_modules'] = %w{
+ status alias auth_basic authn_file authz_default authz_groupfile authz_host authz_user autoindex
+ dir env mime negotiation setenvif
+}
+
+default['apache']['default_modules'] << "log_config" if ["redhat", "centos", "scientific", "fedora", "suse", "arch", "freebsd"].include?(node.platform)
@@ -0,0 +1,32 @@
+#
+# Author:: Joshua Timberman <joshua@opscode.com>
+# Copyright:: Copyright (c) 2011, Opscode, Inc.
+# License:: Apache License, Version 2.0
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+default['apache']['mod_auth_openid']['checksum'] = "79e7ca52511d1230"
+default['apache']['mod_auth_openid']['version'] = "0.6"
+default['apache']['mod_auth_openid']['cache_dir'] = "/var/cache/mod_auth_openid"
+default['apache']['mod_auth_openid']['dblocation'] = "#{node['apache']['mod_auth_openid']['cache_dir']}/mod_auth_openid.db"
+
+case node[:platform]
+when "freebsd"
+ default['apache']['mod_auth_openid']['configure_flags'] = [
+ "CPPFLAGS=-I/usr/local/include",
+ "LDFLAGS=-I/usr/local/lib -lsqlite3"
+ ]
+else
+ default['apache']['mod_auth_openid']['configure_flags'] = []
+end
@@ -0,0 +1,26 @@
+#
+# Cookbook Name:: apache2
+# Definition:: apache_conf
+#
+# Copyright 2008-2009, Opscode, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+define :apache_conf do
+ template "#{node[:apache][:dir]}/mods-available/#{params[:name]}.conf" do
+ source "mods/#{params[:name]}.conf.erb"
+ notifies :restart, resources(:service => "apache2")
+ mode 0644
+ end
+end
@@ -0,0 +1,53 @@
+#
+# Cookbook Name:: apache2
+# Definition:: apache_module
+#
+# Copyright 2008-2009, Opscode, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+define :apache_module, :enable => true, :conf => false do
+ include_recipe "apache2"
+
+ params[:filename] = params[:filename] || "mod_#{params[:name]}.so"
+ params[:module_path] = params[:module_path] || "#{node['apache']['libexecdir']}/#{params[:filename]}"
+
+ if params[:conf]
+ apache_conf params[:name]
+ end
+
+ if platform?("redhat", "centos", "scientific", "fedora", "arch", "suse" )
+ file "#{node['apache']['dir']}/mods-available/#{params[:name]}.load" do
+ content "LoadModule #{params[:name]}_module #{params[:module_path]}\n"
+ mode 0644
+ end
+ end
+
+ if params[:enable]
+ execute "a2enmod #{params[:name]}" do
+ command "/usr/sbin/a2enmod #{params[:name]}"
+ notifies :restart, resources(:service => "apache2")
+ not_if do (File.symlink?("#{node[:apache][:dir]}/mods-enabled/#{params[:name]}.load") and
+ ((File.exists?("#{node[:apache][:dir]}/mods-available/#{params[:name]}.conf"))?
+ (File.symlink?("#{node[:apache][:dir]}/mods-enabled/#{params[:name]}.conf")):(true)))
+ end
+ end
+ else
+ execute "a2dismod #{params[:name]}" do
+ command "/usr/sbin/a2dismod #{params[:name]}"
+ notifies :restart, resources(:service => "apache2")
+ only_if do ::File.symlink?("#{node[:apache][:dir]}/mods-enabled/#{params[:name]}.load") end
+ end
+ end
+end
@@ -0,0 +1,43 @@
+#
+# Cookbook Name:: apache2
+# Definition:: apache_site
+#
+# Copyright 2008-2009, Opscode, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+define :apache_site, :enable => true do
+ include_recipe "apache2"
+
+ if params[:enable]
+ execute "a2ensite #{params[:name]}" do
+ command "/usr/sbin/a2ensite #{params[:name]}"
+ notifies :restart, resources(:service => "apache2")
+ not_if do
+ ::File.symlink?("#{node[:apache][:dir]}/sites-enabled/#{params[:name]}") or
+ ::File.symlink?("#{node[:apache][:dir]}/sites-enabled/000-#{params[:name]}")
+ end
+ only_if do ::File.exists?("#{node[:apache][:dir]}/sites-available/#{params[:name]}") end
+ end
+ else
+ execute "a2dissite #{params[:name]}" do
+ command "/usr/sbin/a2dissite #{params[:name]}"
+ notifies :restart, resources(:service => "apache2")
+ only_if do
+ ::File.symlink?("#{node[:apache][:dir]}/sites-enabled/#{params[:name]}") or
+ ::File.symlink?("#{node[:apache][:dir]}/sites-enabled/000-#{params[:name]}")
+ end
+ end
+ end
+end
@@ -0,0 +1,49 @@
+#
+# Cookbook Name:: apache2
+# Definition:: web_app
+#
+# Copyright 2008-2009, Opscode, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+define :web_app, :template => "web_app.conf.erb", :enable => true do
+
+ application_name = params[:name]
+
+ include_recipe "apache2"
+ include_recipe "apache2::mod_rewrite"
+ include_recipe "apache2::mod_deflate"
+ include_recipe "apache2::mod_headers"
+
+ template "#{node[:apache][:dir]}/sites-available/#{application_name}.conf" do
+ source params[:template]
+ owner "root"
+ group node[:apache][:root_group]
+ mode 0644
+ if params[:cookbook]
+ cookbook params[:cookbook]
+ end
+ variables(
+ :application_name => application_name,
+ :params => params
+ )
+ if ::File.exists?("#{node[:apache][:dir]}/sites-enabled/#{application_name}.conf")
+ notifies :reload, resources(:service => "apache2"), :delayed
+ end
+ end
+
+ apache_site "#{params[:name]}.conf" do
+ enable params[:enable]
+ end
+end
Oops, something went wrong.

0 comments on commit a1e925b

Please sign in to comment.