Permalink
Browse files

initial commit in DevOpsGameDay

  • Loading branch information...
0 parents commit b6bae30ea04d289739140394a6d30ebef8d781d8 @metaxis metaxis committed Jul 14, 2010
Showing with 15,408 additions and 0 deletions.
  1. +4 −0 .gitignore
  2. +7 −0 README
  3. +65 −0 Rakefile
  4. +6 −0 certificates/README
  5. +38 −0 config/rake.rb
  6. +2 −0 cookbooks/README
  7. +78 −0 cookbooks/apache2/README.rdoc
  8. +77 −0 cookbooks/apache2/attributes/default.rb
  9. +25 −0 cookbooks/apache2/definitions/apache_conf.rb
  10. +43 −0 cookbooks/apache2/definitions/apache_module.rb
  11. +40 −0 cookbooks/apache2/definitions/apache_site.rb
  12. +49 −0 cookbooks/apache2/definitions/web_app.rb
  13. +41 −0 cookbooks/apache2/files/default/apache2_module_conf_generate.pl
  14. +497 −0 cookbooks/apache2/metadata.json
  15. +197 −0 cookbooks/apache2/metadata.rb
  16. +191 −0 cookbooks/apache2/recipes/default.rb
  17. +33 −0 cookbooks/apache2/recipes/god_monitor.rb
  18. +22 −0 cookbooks/apache2/recipes/mod_alias.rb
  19. +20 −0 cookbooks/apache2/recipes/mod_auth_basic.rb
  20. +20 −0 cookbooks/apache2/recipes/mod_auth_digest.rb
  21. +59 −0 cookbooks/apache2/recipes/mod_auth_openid.rb
  22. +20 −0 cookbooks/apache2/recipes/mod_authn_file.rb
  23. +20 −0 cookbooks/apache2/recipes/mod_authnz_ldap.rb
  24. +20 −0 cookbooks/apache2/recipes/mod_authz_default.rb
  25. +20 −0 cookbooks/apache2/recipes/mod_authz_groupfile.rb
  26. +20 −0 cookbooks/apache2/recipes/mod_authz_host.rb
  27. +20 −0 cookbooks/apache2/recipes/mod_authz_user.rb
  28. +22 −0 cookbooks/apache2/recipes/mod_autoindex.rb
  29. +20 −0 cookbooks/apache2/recipes/mod_cgi.rb
  30. +20 −0 cookbooks/apache2/recipes/mod_dav.rb
  31. +22 −0 cookbooks/apache2/recipes/mod_dav_svn.rb
  32. +22 −0 cookbooks/apache2/recipes/mod_deflate.rb
  33. +22 −0 cookbooks/apache2/recipes/mod_dir.rb
  34. +20 −0 cookbooks/apache2/recipes/mod_env.rb
  35. +20 −0 cookbooks/apache2/recipes/mod_expires.rb
  36. +46 −0 cookbooks/apache2/recipes/mod_fcgid.rb
  37. +20 −0 cookbooks/apache2/recipes/mod_headers.rb
  38. +20 −0 cookbooks/apache2/recipes/mod_ldap.rb
  39. +24 −0 cookbooks/apache2/recipes/mod_log_config.rb
  40. +22 −0 cookbooks/apache2/recipes/mod_mime.rb
  41. +22 −0 cookbooks/apache2/recipes/mod_negotiation.rb
  42. +32 −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. +22 −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. +42 −0 cookbooks/apache2/recipes/mod_ssl.rb
  52. +22 −0 cookbooks/apache2/recipes/mod_status.rb
  53. +22 −0 cookbooks/apache2/templates/default/a2dismod.erb
  54. +29 −0 cookbooks/apache2/templates/default/a2dissite.erb
  55. +37 −0 cookbooks/apache2/templates/default/a2enmod.erb
  56. +38 −0 cookbooks/apache2/templates/default/a2ensite.erb
  57. +235 −0 cookbooks/apache2/templates/default/apache2.conf.erb
  58. +19 −0 cookbooks/apache2/templates/default/apache2.god.erb
  59. +6 −0 cookbooks/apache2/templates/default/charset.erb
  60. +57 −0 cookbooks/apache2/templates/default/default-site.erb
  61. +12 −0 cookbooks/apache2/templates/default/mod_auth_openid.rb.erb
  62. +2 −0 cookbooks/apache2/templates/default/mods/README
  63. +24 −0 cookbooks/apache2/templates/default/mods/alias.conf.erb
  64. +1 −0 cookbooks/apache2/templates/default/mods/authopenid.load.erb
  65. +101 −0 cookbooks/apache2/templates/default/mods/autoindex.conf.erb
  66. +16 −0 cookbooks/apache2/templates/default/mods/deflate.conf.erb
  67. +5 −0 cookbooks/apache2/templates/default/mods/dir.conf.erb
  68. +10 −0 cookbooks/apache2/templates/default/mods/fcgid.conf.erb
  69. +191 −0 cookbooks/apache2/templates/default/mods/mime.conf.erb
  70. +18 −0 cookbooks/apache2/templates/default/mods/negotiation.conf.erb
  71. +19 −0 cookbooks/apache2/templates/default/mods/proxy.conf.erb
  72. +28 −0 cookbooks/apache2/templates/default/mods/setenvif.conf.erb
  73. +72 −0 cookbooks/apache2/templates/default/mods/ssl.conf.erb
  74. +16 −0 cookbooks/apache2/templates/default/mods/status.conf.erb
  75. +2 −0 cookbooks/apache2/templates/default/port_apache.erb
  76. +6 −0 cookbooks/apache2/templates/default/ports.conf.erb
  77. +50 −0 cookbooks/apache2/templates/default/security.erb
  78. +43 −0 cookbooks/apache2/templates/default/web_app.conf.erb
  79. +139 −0 cookbooks/dynect/README.md
  80. +29 −0 cookbooks/dynect/attributes/default.rb
  81. +29 −0 cookbooks/dynect/metadata.json
  82. +6 −0 cookbooks/dynect/metadata.rb
  83. +99 −0 cookbooks/dynect/providers/rr.rb
  84. +31 −0 cookbooks/dynect/recipes/a_record.rb
  85. +25 −0 cookbooks/dynect/recipes/default.rb
  86. +75 −0 cookbooks/dynect/recipes/ec2.rb
  87. +30 −0 cookbooks/dynect/resources/rr.rb
  88. +116 −0 cookbooks/dynect_dns/README.rdoc
  89. +39 −0 cookbooks/dynect_dns/metadata.json
  90. +7 −0 cookbooks/dynect_dns/metadata.rb
  91. +58 −0 cookbooks/dynect_dns/providers/gslb.rb
  92. +103 −0 cookbooks/dynect_dns/providers/gslb_region_pool.rb
  93. +33 −0 cookbooks/dynect_dns/recipes/add_region_entry.rb
  94. +20 −0 cookbooks/dynect_dns/recipes/default.rb
  95. +30 −0 cookbooks/dynect_dns/recipes/gslb.rb
  96. +35 −0 cookbooks/dynect_dns/recipes/nom_to_degr_02.rb
  97. +33 −0 cookbooks/dynect_dns/recipes/nom_to_degr_03.rb
  98. +35 −0 cookbooks/dynect_dns/recipes/recover_02.rb
  99. +33 −0 cookbooks/dynect_dns/recipes/recover_03.rb
  100. +33 −0 cookbooks/dynect_dns/recipes/update_region_entry.rb
  101. +35 −0 cookbooks/dynect_dns/resources/gslb.rb
  102. +33 −0 cookbooks/dynect_dns/resources/gslb_region_pool.rb
  103. +95 −0 cookbooks/mysql/README.rdoc
  104. +42 −0 cookbooks/mysql/attributes/server.rb
  105. +15 −0 cookbooks/mysql/libraries/database.rb
  106. +214 −0 cookbooks/mysql/metadata.json
  107. +73 −0 cookbooks/mysql/metadata.rb
  108. +13 −0 cookbooks/mysql/providers/database.rb
  109. +50 −0 cookbooks/mysql/recipes/client.rb
  110. +20 −0 cookbooks/mysql/recipes/default.rb
  111. +101 −0 cookbooks/mysql/recipes/server.rb
  112. +49 −0 cookbooks/mysql/recipes/server_ec2.rb
  113. +5 −0 cookbooks/mysql/resources/database.rb
  114. +12 −0 cookbooks/mysql/templates/centos/my.cnf.erb
  115. +11 −0 cookbooks/mysql/templates/default/debian.cnf.erb
  116. +12 −0 cookbooks/mysql/templates/default/grants.sql.erb
  117. +163 −0 cookbooks/mysql/templates/default/my.cnf.erb
  118. +10 −0 cookbooks/mysql/templates/default/mysql-server.seed.erb
  119. +3 −0 cookbooks/mysql/templates/default/port_mysql.erb
  120. +12 −0 cookbooks/mysql/templates/redhat/my.cnf.erb
  121. +158 −0 cookbooks/mysql/templates/ubuntu-10.04/my.cnf.erb
  122. +156 −0 cookbooks/mysql/templates/ubuntu-8.04/my.cnf.erb
  123. +158 −0 cookbooks/mysql/templates/ubuntu-9.10/my.cnf.erb
  124. +33 −0 cookbooks/openssl/README.rdoc
  125. +37 −0 cookbooks/openssl/libraries/secure_password.rb
  126. +29 −0 cookbooks/openssl/metadata.json
  127. +6 −0 cookbooks/openssl/metadata.rb
  128. +19 −0 cookbooks/openssl/recipes/default.rb
  129. +31 −0 cookbooks/php/definitions/pear_channel.rb
  130. +31 −0 cookbooks/php/definitions/pear_module.rb
  131. +42 −0 cookbooks/php/definitions/php_app.rb
  132. +1,251 −0 cookbooks/php/files/default/apache2-php5.ini
  133. +52 −0 cookbooks/php/metadata.json
  134. +24 −0 cookbooks/php/metadata.rb
  135. +19 −0 cookbooks/php/recipes/default.rb
  136. +23 −0 cookbooks/php/recipes/module_apc.rb
  137. +23 −0 cookbooks/php/recipes/module_curl.rb
  138. +23 −0 cookbooks/php/recipes/module_fileinfo.rb
  139. +23 −0 cookbooks/php/recipes/module_fpdf.rb
  140. +23 −0 cookbooks/php/recipes/module_gd.rb
  141. +23 −0 cookbooks/php/recipes/module_ldap.rb
  142. +23 −0 cookbooks/php/recipes/module_memcache.rb
  143. +23 −0 cookbooks/php/recipes/module_mysql.rb
  144. +23 −0 cookbooks/php/recipes/module_pgsql.rb
  145. +23 −0 cookbooks/php/recipes/module_sqlite3.rb
  146. +23 −0 cookbooks/php/recipes/pear.rb
  147. +25 −0 cookbooks/php/recipes/php4.rb
  148. +30 −0 cookbooks/php/recipes/php5-cgi.rb
  149. +41 −0 cookbooks/php/recipes/php5.rb
  150. +63 −0 cookbooks/php/templates/default/php.conf.erb
  151. +52 −0 cookbooks/ruby/metadata.json
  152. +9 −0 cookbooks/ruby/metadata.rb
  153. +49 −0 cookbooks/ruby/recipes/default.rb
  154. +72 −0 cookbooks/wordpress/README.rdoc
  155. +34 −0 cookbooks/wordpress/attributes/wordpress.rb
  156. +746 −0 cookbooks/wordpress/files/default/db.php
  157. +18 −0 cookbooks/wordpress/files/default/dyntini-theme/404.php
  158. +77 −0 cookbooks/wordpress/files/default/dyntini-theme/archive.php
  159. +29 −0 cookbooks/wordpress/files/default/dyntini-theme/archives.php
  160. +124 −0 cookbooks/wordpress/files/default/dyntini-theme/comments-popup.php
  161. +96 −0 cookbooks/wordpress/files/default/dyntini-theme/comments.php
  162. +26 −0 cookbooks/wordpress/files/default/dyntini-theme/footer.php
  163. +433 −0 cookbooks/wordpress/files/default/dyntini-theme/functions.php
  164. +45 −0 cookbooks/wordpress/files/default/dyntini-theme/header.php
  165. +70 −0 cookbooks/wordpress/files/default/dyntini-theme/image.php
  166. BIN cookbooks/wordpress/files/default/dyntini-theme/images/audio.jpg
  167. BIN cookbooks/wordpress/files/default/dyntini-theme/images/banner.jpg
  168. BIN cookbooks/wordpress/files/default/dyntini-theme/images/bg.jpg
  169. BIN cookbooks/wordpress/files/default/dyntini-theme/images/bg_burst.png
  170. BIN cookbooks/wordpress/files/default/dyntini-theme/images/game-day-400.jpg
  171. BIN cookbooks/wordpress/files/default/dyntini-theme/images/game-day-full.jpg
  172. +82 −0 cookbooks/wordpress/files/default/dyntini-theme/images/header-img.php
  173. BIN cookbooks/wordpress/files/default/dyntini-theme/images/kubrickbg-ltr.jpg
  174. BIN cookbooks/wordpress/files/default/dyntini-theme/images/kubrickbg-rtl.jpg
  175. BIN cookbooks/wordpress/files/default/dyntini-theme/images/kubrickbgcolor.jpg
  176. BIN cookbooks/wordpress/files/default/dyntini-theme/images/kubrickbgwide.jpg
  177. BIN cookbooks/wordpress/files/default/dyntini-theme/images/kubrickfooter.jpg
  178. BIN cookbooks/wordpress/files/default/dyntini-theme/images/kubrickheader.jpg
  179. +45 −0 cookbooks/wordpress/files/default/dyntini-theme/index.php
  180. +23 −0 cookbooks/wordpress/files/default/dyntini-theme/links.php
  181. +30 −0 cookbooks/wordpress/files/default/dyntini-theme/page.php
  182. +127 −0 cookbooks/wordpress/files/default/dyntini-theme/rtl.css
  183. BIN cookbooks/wordpress/files/default/dyntini-theme/screenshot.png
  184. +48 −0 cookbooks/wordpress/files/default/dyntini-theme/search.php
  185. +83 −0 cookbooks/wordpress/files/default/dyntini-theme/sidebar.php
  186. +73 −0 cookbooks/wordpress/files/default/dyntini-theme/single.php
  187. +754 −0 cookbooks/wordpress/files/default/dyntini-theme/style.css
  188. +860 −0 cookbooks/wordpress/files/default/twitter-widget-pro/class-json.php
  189. BIN cookbooks/wordpress/files/default/twitter-widget-pro/languages/twitter-widget-pro-da_DK.mo
  190. +207 −0 cookbooks/wordpress/files/default/twitter-widget-pro/languages/twitter-widget-pro-da_DK.po
  191. BIN cookbooks/wordpress/files/default/twitter-widget-pro/languages/twitter-widget-pro-es_ES.mo
  192. +200 −0 cookbooks/wordpress/files/default/twitter-widget-pro/languages/twitter-widget-pro-es_ES.po
  193. BIN cookbooks/wordpress/files/default/twitter-widget-pro/languages/twitter-widget-pro-it_IT.mo
  194. +331 −0 cookbooks/wordpress/files/default/twitter-widget-pro/languages/twitter-widget-pro-it_IT.po
  195. BIN cookbooks/wordpress/files/default/twitter-widget-pro/languages/twitter-widget-pro-sv_SE.mo
  196. +201 −0 cookbooks/wordpress/files/default/twitter-widget-pro/languages/twitter-widget-pro-sv_SE.po
  197. +280 −0 cookbooks/wordpress/files/default/twitter-widget-pro/languages/twitter-widget-pro.pot
  198. +253 −0 cookbooks/wordpress/files/default/twitter-widget-pro/readme.txt
  199. BIN cookbooks/wordpress/files/default/twitter-widget-pro/screenshot-1.png
  200. BIN cookbooks/wordpress/files/default/twitter-widget-pro/screenshot-2.png
  201. BIN cookbooks/wordpress/files/default/twitter-widget-pro/screenshot-3.png
  202. BIN cookbooks/wordpress/files/default/twitter-widget-pro/screenshot-4.png
  203. +801 −0 cookbooks/wordpress/files/default/twitter-widget-pro/wp-twitter-widget.php
  204. +3 −0 cookbooks/wordpress/files/default/twitter-widget-pro/xavisys-plugin-framework.css
  205. +354 −0 cookbooks/wordpress/files/default/twitter-widget-pro/xavisys-plugin-framework.php
  206. +187 −0 cookbooks/wordpress/metadata.json
  207. +65 −0 cookbooks/wordpress/metadata.rb
  208. +146 −0 cookbooks/wordpress/recipes/default.rb
  209. +128 −0 cookbooks/wordpress/templates/default/admin-header.php.erb
  210. +292 −0 cookbooks/wordpress/templates/default/db-config.php.erb
  211. +5 −0 cookbooks/wordpress/templates/default/grants.sql.erb
  212. +22 −0 cookbooks/wordpress/templates/default/wordpress.conf.erb
  213. +76 −0 cookbooks/wordpress/templates/default/wp-config.php.erb
  214. +13 −0 data_bags/README
  215. +17 −0 roles/README
  216. +22 −0 roles/base.rb
  217. +17 −0 roles/wordpress1.rb
  218. +21 −0 roles/wordpress2.rb
  219. +21 −0 roles/wordpress3.rb
@@ -0,0 +1,4 @@
+.rake_test_cache
+.chef
+*.swp
+*.swo
@@ -0,0 +1,7 @@
+This is a blank repository you can use as a starting point for your
+local chef configuration.
+
+For full details on the parts aside from information contained in the
+README files, see the Chef wiki documentation at:
+
+http://wiki.opscode.com/display/chef/Chef+Repository
@@ -0,0 +1,65 @@
+#
+# Rakefile for Chef Server Repository
+#
+# Author:: Adam Jacob (<adam@opscode.com>)
+# Copyright:: Copyright (c) 2008 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.
+#
+
+require 'rubygems'
+require 'chef'
+require 'json'
+
+# Load constants from rake config file.
+require File.join(File.dirname(__FILE__), 'config', 'rake')
+
+# Detect the version control system and assign to $vcs. Used by the update
+# task in chef_repo.rake (below). The install task calls update, so this
+# is run whenever the repo is installed.
+#
+# Comment out these lines to skip the update.
+
+if File.directory?(File.join(TOPDIR, ".svn"))
+ $vcs = :svn
+elsif File.directory?(File.join(TOPDIR, ".git"))
+ $vcs = :git
+end
+
+# Load common, useful tasks from Chef.
+# rake -T to see the tasks this loads.
+
+load 'chef/tasks/chef_repo.rake'
+
+desc "Bundle a single cookbook for distribution"
+task :bundle_cookbook => [ :metadata ]
+task :bundle_cookbook, :cookbook do |t, args|
+ tarball_name = "#{args.cookbook}.tar.gz"
+ temp_dir = File.join(Dir.tmpdir, "chef-upload-cookbooks")
+ temp_cookbook_dir = File.join(temp_dir, args.cookbook)
+ tarball_dir = File.join(TOPDIR, "pkgs")
+ FileUtils.mkdir_p(tarball_dir)
+ FileUtils.mkdir(temp_dir)
+ FileUtils.mkdir(temp_cookbook_dir)
+
+ child_folders = [ "cookbooks/#{args.cookbook}", "site-cookbooks/#{args.cookbook}" ]
+ child_folders.each do |folder|
+ file_path = File.join(TOPDIR, folder, ".")
+ FileUtils.cp_r(file_path, temp_cookbook_dir) if File.directory?(file_path)
+ end
+
+ system("tar", "-C", temp_dir, "-cvzf", File.join(tarball_dir, tarball_name), "./#{args.cookbook}")
+
+ FileUtils.rm_rf temp_dir
+end
@@ -0,0 +1,6 @@
+Creating SSL certificates is a common task done in web application
+infrastructures, so a rake task is provided to generate certificates.
+These certificates are stored here by the ssl_cert task. To generate a
+certificate set for a new monitoring server, for example:
+
+ rake ssl_cert FQDN=monitoring.example.com
@@ -0,0 +1,38 @@
+# Configure the Rakefile's tasks.
+
+###
+# Company and SSL Details
+# Used with the ssl_cert task.
+###
+
+# The company name - used for SSL certificates, and in srvious other places
+COMPANY_NAME = "Example Com"
+
+# The Country Name to use for SSL Certificates
+SSL_COUNTRY_NAME = "US"
+
+# The State Name to use for SSL Certificates
+SSL_STATE_NAME = "Several"
+
+# The Locality Name for SSL - typically, the city
+SSL_LOCALITY_NAME = "Locality"
+
+# What department?
+SSL_ORGANIZATIONAL_UNIT_NAME = "Operations"
+
+# The SSL contact email address
+SSL_EMAIL_ADDRESS = "ops@example.com"
+
+# License for new Cookbooks
+# Can be :apachev2 or :none
+NEW_COOKBOOK_LICENSE = :apachev2
+
+###
+# Useful Extras (which you probably don't need to change)
+###
+
+# The top of the repository checkout
+TOPDIR = File.expand_path(File.join(File.dirname(__FILE__), ".."))
+
+# Where to store certificates generated with ssl_cert
+CADIR = File.expand_path(File.join(TOPDIR, "certificates"))
@@ -0,0 +1,2 @@
+Download cookbooks into this directory from the Opscode Cookbooks site
+using knife, or remove this file to clone an upstream Git Repository.
@@ -0,0 +1,78 @@
+= DESCRIPTION:
+
+Complete Debian/Ubuntu style Apache2 configuration.
+
+= REQUIREMENTS:
+
+Debian or Ubuntu preferred.
+
+Red Hat/CentOS and Fedora can be used but will be converted to a Debian/Ubuntu style Apache as it's far easier to manage with chef.
+
+= ATTRIBUTES:
+
+The file attributes/apache.rb contains the following attribute types:
+
+* platform specific locations and settings.
+* general settings
+* prefork attributes
+* worker attributes
+
+General settings and prefork/worker attributes are tunable.
+
+= USAGE:
+
+Include the apache2 recipe to install Apache2 and get 'sane' default settings. Configuration is modularized through Apache vhost sites a la Debian style configuration.
+
+For Red Hat, CentOS and Fedora you should first disable selinux as it's not supported (yet), then remove the stock httpd and all it's dependencies prior to attempting to use this recipe. Many packages in these distributions drop conflicting configs into conf.d, all of which haven't been accounted for yet. Starting from scratch will also make it far easier to debug.
+
+== Defines:
+
+* apache_module: sets up an Apache module.
+* apache_conf: sets up a config file for an apache module.
+* apache_site: sets up a vhost site. The conf file must be available.
+* web_app: copies the template for a web app and enables it as a site via apache_site.
+
+== Web Apps:
+
+Various applications that can be set up with Apache as the front end, such as PHP, Django, Rails and others can use the web_app define to set up the template and the Apache site. The define is kind of dumb, so the template needs have the application implementation settings, since we don't know what your app is or what is needed from Apache.
+
+We only prototype one parameter for the web_app define, "template". This is used to specify the name of the template to use in the current cookbook. When you use web_app, you can set up any parameters you want to use in your template. They will get passed to the template through the params hash. For example, the sample web_app.conf.erb template in this cookbook makes use of these.
+
+* docroot
+* server_name
+* server_aliases
+
+These are available as @params[:docroot], @params[:server_name], @params[:server_aliases] within the template.
+
+If 'cookbook' and 'template' are not specified, the current cookbook's templates/default/web_app.conf.erb will be used. If this template is not suitable for your application, copy it to your cookbook and customize as needed.
+
+== God Monitor:
+
+There's a new recipe, apache2::god_monitor. You will need to make sure to include the 'god' recipe before using the apache2::god_monitor recipe in your cookbook.
+
+== OpenID Auth
+
+Installs the mod_auth_openid module from source. Specify an array of OpenIDs that are allowed to authenticate with the attribute apache[:allowed_openids]. Use the following in a vhost to protect with OpenID authentication:
+
+ AuthOpenIDEnabled On
+ AuthOpenIDDBLocation /var/cache/apache2/mod_auth_openid.db
+ AuthOpenIDUserProgram /usr/local/bin/mod_auth_openid.rb
+
+Change the DBLocation as appropriate for your platform. You'll need to change the file in the recipe to match. The UserProgram is optional if you don't want to limit access by certain OpenIDs.
+
+= LICENSE & AUTHOR:
+
+Author:: Joshua Timberman (<joshua@opscode.com>)
+Copyright:: 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.
@@ -0,0 +1,77 @@
+#
+# 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.
+#
+
+# Where the various parts of apache are
+case platform
+when "redhat","centos","fedora","suse"
+ set[:apache][:dir] = "/etc/httpd"
+ set[:apache][:log_dir] = "/var/log/httpd"
+ set[:apache][:user] = "apache"
+ set[:apache][:binary] = "/usr/sbin/httpd"
+ set[:apache][:icondir] = "/var/www/icons/"
+when "debian","ubuntu"
+ set[:apache][:dir] = "/etc/apache2"
+ set[:apache][:log_dir] = "/var/log/apache2"
+ set[:apache][:user] = "www-data"
+ set[:apache][:binary] = "/usr/sbin/apache2"
+ set[:apache][:icondir] = "/usr/share/apache2/icons"
+else
+ set[:apache][:dir] = "/etc/apache2"
+ set[:apache][:log_dir] = "/var/log/apache2"
+ set[:apache][:user] = "www-data"
+ set[:apache][:binary] = "/usr/sbin/apache2"
+ set[:apache][:icondir] = "/usr/share/apache2/icons"
+end
+
+###
+# These settings need the unless, since we want them to be tunable,
+# and we don't want to override the tunings.
+###
+
+# General settings
+set_unless[:apache][:listen_ports] = [ "80","443" ]
+set_unless[:apache][:contact] = "ops@example.com"
+set_unless[:apache][:timeout] = 300
+set_unless[:apache][:keepalive] = "On"
+set_unless[:apache][:keepaliverequests] = 100
+set_unless[:apache][:keepalivetimeout] = 5
+
+# Security
+set_unless[:apache][:servertokens] = "Prod"
+set_unless[:apache][:serversignature] = "On"
+set_unless[:apache][:traceenable] = "On"
+
+# mod_auth_openids
+set_unless[:apache][:allowed_openids] = Array.new
+
+# Prefork Attributes
+set_unless[:apache][:prefork][:startservers] = 16
+set_unless[:apache][:prefork][:minspareservers] = 16
+set_unless[:apache][:prefork][:maxspareservers] = 32
+set_unless[:apache][:prefork][:serverlimit] = 400
+set_unless[:apache][:prefork][:maxclients] = 400
+set_unless[:apache][:prefork][:maxrequestsperchild] = 10000
+
+# Worker Attributes
+set_unless[:apache][:worker][:startservers] = 4
+set_unless[:apache][:worker][:maxclients] = 1024
+set_unless[:apache][:worker][:minsparethreads] = 64
+set_unless[:apache][:worker][:maxsparethreads] = 192
+set_unless[:apache][:worker][:threadsperchild] = 64
+set_unless[:apache][:worker][:maxrequestsperchild] = 0
@@ -0,0 +1,25 @@
+#
+# 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")
+ end
+end
@@ -0,0 +1,43 @@
+#
+# 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"
+
+ if params[:conf]
+ apache_conf params[:name]
+ 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,40 @@
+#
+# 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]}") end
+ end
+ end
+end
Oops, something went wrong.

0 comments on commit b6bae30

Please sign in to comment.