Permalink
Browse files

initial commit

  • Loading branch information...
0 parents commit 7b44c3533e56cc87c4e576d4c99694a565f65bb6 @sethvargo committed Oct 24, 2012
Showing with 8,726 additions and 0 deletions.
  1. +6 −0 .chef/knife.rb
  2. +12 −0 .gitignore
  3. +1 −0 .rvmrc
  4. +3 −0 Gemfile
  5. +62 −0 Gemfile.lock
  6. +10 −0 README.md
  7. +65 −0 Rakefile
  8. +19 −0 certificates/README.md
  9. +38 −0 config/rake.rb
  10. +11 −0 cookbooks/aws/CHANGELOG.md
  11. +29 −0 cookbooks/aws/CONTRIBUTING
  12. +201 −0 cookbooks/aws/LICENSE
  13. +271 −0 cookbooks/aws/README.md
  14. +20 −0 cookbooks/aws/attributes/default.rb
  15. +58 −0 cookbooks/aws/libraries/ec2.rb
  16. +7 −0 cookbooks/aws/metadata.rb
  17. +223 −0 cookbooks/aws/providers/ebs_volume.rb
  18. +83 −0 cookbooks/aws/providers/elastic_ip.rb
  19. +22 −0 cookbooks/aws/providers/elastic_lb.rb
  20. +91 −0 cookbooks/aws/providers/resource_tag.rb
  21. +25 −0 cookbooks/aws/recipes/default.rb
  22. +17 −0 cookbooks/aws/resources/ebs_volume.rb
  23. +11 −0 cookbooks/aws/resources/elastic_ip.rb
  24. +10 −0 cookbooks/aws/resources/elastic_lb.rb
  25. +11 −0 cookbooks/aws/resources/resource_tag.rb
  26. +4 −0 cookbooks/bluepill/.gitignore
  27. +31 −0 cookbooks/bluepill/CHANGELOG.md
  28. +29 −0 cookbooks/bluepill/CONTRIBUTING
  29. +5 −0 cookbooks/bluepill/Gemfile
  30. +124 −0 cookbooks/bluepill/Gemfile.lock
  31. +201 −0 cookbooks/bluepill/LICENSE
  32. +80 −0 cookbooks/bluepill/README.md
  33. +34 −0 cookbooks/bluepill/attributes/default.rb
  34. +7 −0 cookbooks/bluepill/metadata.rb
  35. +155 −0 cookbooks/bluepill/providers/service.rb
  36. +33 −0 cookbooks/bluepill/recipes/default.rb
  37. +27 −0 cookbooks/bluepill/resources/service.rb
  38. +32 −0 cookbooks/bluepill/templates/centos/bluepill_init.erb
  39. +31 −0 cookbooks/bluepill/templates/freebsd/bluepill_init.erb
  40. +15 −0 cookbooks/build-essential/CHANGELOG.md
  41. +29 −0 cookbooks/build-essential/CONTRIBUTING
  42. +201 −0 cookbooks/build-essential/LICENSE
  43. +124 −0 cookbooks/build-essential/README.md
  44. +33 −0 cookbooks/build-essential/attributes/default.rb
  45. +12 −0 cookbooks/build-essential/metadata.rb
  46. +79 −0 cookbooks/build-essential/recipes/default.rb
  47. +1 −0 cookbooks/database/.gitignore
  48. +46 −0 cookbooks/database/CHANGELOG.md
  49. +29 −0 cookbooks/database/CONTRIBUTING
  50. +201 −0 cookbooks/database/LICENSE
  51. +468 −0 cookbooks/database/README.md
  52. +103 −0 cookbooks/database/libraries/provider_database_mysql.rb
  53. +76 −0 cookbooks/database/libraries/provider_database_mysql_user.rb
  54. +131 −0 cookbooks/database/libraries/provider_database_postgresql.rb
  55. +83 −0 cookbooks/database/libraries/provider_database_postgresql_user.rb
  56. +109 −0 cookbooks/database/libraries/provider_database_sql_server.rb
  57. +106 −0 cookbooks/database/libraries/provider_database_sql_server_user.rb
  58. +119 −0 cookbooks/database/libraries/resource_database.rb
  59. +90 −0 cookbooks/database/libraries/resource_database_user.rb
  60. +34 −0 cookbooks/database/libraries/resource_mysql_database.rb
  61. +34 −0 cookbooks/database/libraries/resource_mysql_database_user.rb
  62. +35 −0 cookbooks/database/libraries/resource_postgresql_database.rb
  63. +35 −0 cookbooks/database/libraries/resource_postgresql_database_user.rb
  64. +34 −0 cookbooks/database/libraries/resource_sql_server_database.rb
  65. +34 −0 cookbooks/database/libraries/resource_sql_server_database_user.rb
  66. +22 −0 cookbooks/database/metadata.rb
  67. +20 −0 cookbooks/database/recipes/default.rb
  68. +89 −0 cookbooks/database/recipes/ebs_backup.rb
  69. +204 −0 cookbooks/database/recipes/ebs_volume.rb
  70. +78 −0 cookbooks/database/recipes/master.rb
  71. +20 −0 cookbooks/database/recipes/mysql.rb
  72. +20 −0 cookbooks/database/recipes/postgresql.rb
  73. +62 −0 cookbooks/database/recipes/snapshot.rb
  74. +8 −0 cookbooks/database/templates/default/app_grants.sql.erb
  75. +3 −0 cookbooks/database/templates/default/aws_config.erb
  76. +6 −0 cookbooks/database/templates/default/chef-solo-database-snapshot.cron.erb
  77. +1 −0 cookbooks/database/templates/default/chef-solo-database-snapshot.json.erb
  78. +6 −0 cookbooks/database/templates/default/chef-solo-database-snapshot.rb.erb
  79. +2 −0 cookbooks/database/templates/default/ebs-backup-cron.erb
  80. +8 −0 cookbooks/database/templates/default/ebs-db-backup.sh.erb
  81. +10 −0 cookbooks/database/templates/default/ebs-db-restore.sh.erb
  82. +27 −0 cookbooks/database/templates/default/s3cfg.erb
  83. +5 −0 cookbooks/mysql/.gitignore
  84. +86 −0 cookbooks/mysql/CHANGELOG.md
  85. +29 −0 cookbooks/mysql/CONTRIBUTING
  86. +8 −0 cookbooks/mysql/Gemfile
  87. +201 −0 cookbooks/mysql/LICENSE
  88. +224 −0 cookbooks/mysql/README.md
  89. +50 −0 cookbooks/mysql/attributes/client.rb
  90. +154 −0 cookbooks/mysql/attributes/server.rb
  91. +11 −0 cookbooks/mysql/files/default/tests/minitest/helpers.rb
  92. +36 −0 cookbooks/mysql/files/default/tests/minitest/server_test.rb
  93. +33 −0 cookbooks/mysql/libraries/helpers.rb
  94. +140 −0 cookbooks/mysql/metadata.rb
  95. +59 −0 cookbooks/mysql/recipes/client.rb
  96. +20 −0 cookbooks/mysql/recipes/default.rb
  97. +36 −0 cookbooks/mysql/recipes/ruby.rb
  98. +201 −0 cookbooks/mysql/recipes/server.rb
  99. +51 −0 cookbooks/mysql/recipes/server_ec2.rb
  100. +12 −0 cookbooks/mysql/templates/default/debian.cnf.erb
  101. +15 −0 cookbooks/mysql/templates/default/grants.sql.erb
  102. +211 −0 cookbooks/mysql/templates/default/my.cnf.erb
  103. +10 −0 cookbooks/mysql/templates/default/mysql-server.seed.erb
  104. +3 −0 cookbooks/mysql/templates/default/port_mysql.erb
  105. +61 −0 cookbooks/mysql/templates/windows/my.cnf.erb
  106. +37 −0 cookbooks/openssl/README.md
  107. +37 −0 cookbooks/openssl/libraries/secure_password.rb
  108. +8 −0 cookbooks/openssl/metadata.rb
  109. +19 −0 cookbooks/openssl/recipes/default.rb
  110. +35 −0 cookbooks/postgresql/CHANGELOG.md
  111. +29 −0 cookbooks/postgresql/CONTRIBUTING
  112. +201 −0 cookbooks/postgresql/LICENSE
  113. +148 −0 cookbooks/postgresql/README.md
  114. +102 −0 cookbooks/postgresql/attributes/default.rb
  115. +21 −0 cookbooks/postgresql/metadata.rb
  116. +26 −0 cookbooks/postgresql/recipes/client.rb
  117. +20 −0 cookbooks/postgresql/recipes/default.rb
  118. +36 −0 cookbooks/postgresql/recipes/ruby.rb
  119. +65 −0 cookbooks/postgresql/recipes/server.rb
  120. +64 −0 cookbooks/postgresql/recipes/server_debian.rb
  121. +62 −0 cookbooks/postgresql/recipes/server_redhat.rb
  122. +499 −0 cookbooks/postgresql/templates/default/debian.postgresql.conf.erb
  123. +83 −0 cookbooks/postgresql/templates/default/pg_hba.conf.erb
  124. +501 −0 cookbooks/postgresql/templates/default/redhat.postgresql.conf.erb
  125. +30 −0 cookbooks/xfs/README.md
  126. +12 −0 cookbooks/xfs/metadata.rb
  127. +26 −0 cookbooks/xfs/recipes/default.rb
  128. +63 −0 data_bags/README.md
@@ -0,0 +1,6 @@
+current_dir = File.dirname(__FILE__)
+
+log_level :warn
+log_location STDOUT
+cache_options(:path => "#{ENV['HOME']}/.chef/checksums")
+cookbook_path ["#{current_dir}/../cookbooks"]
@@ -0,0 +1,12 @@
+.rake_test_cache
+metadata.json
+*.swp
+.DS_Store
+kickstart/*.ks
+.rbenv-version
+vendor/ruby
+.bundle/
+vendor/cache/
+bin/
+tmux*log
+1
1 .rvmrc
@@ -0,0 +1 @@
+rvm use 1.9.3@tdding-tmux --create
@@ -0,0 +1,3 @@
+source :rubygems
+
+gem 'chef'
@@ -0,0 +1,62 @@
+GEM
+ remote: http://rubygems.org/
+ specs:
+ bunny (0.8.0)
+ chef (10.12.0)
+ bunny (>= 0.6.0)
+ erubis
+ highline (>= 1.6.9)
+ json (>= 1.4.4, <= 1.6.1)
+ mixlib-authentication (>= 1.1.0)
+ mixlib-cli (>= 1.1.0)
+ mixlib-config (>= 1.1.2)
+ mixlib-log (>= 1.3.0)
+ mixlib-shellout
+ moneta
+ net-ssh (~> 2.2.2)
+ net-ssh-multi (~> 1.1.0)
+ ohai (>= 0.6.0)
+ rest-client (>= 1.0.4, < 1.7.0)
+ treetop (~> 1.4.9)
+ uuidtools
+ yajl-ruby (~> 1.1)
+ erubis (2.7.0)
+ highline (1.6.15)
+ ipaddress (0.8.0)
+ json (1.6.1)
+ mime-types (1.19)
+ mixlib-authentication (1.3.0)
+ mixlib-log
+ mixlib-cli (1.2.2)
+ mixlib-config (1.1.2)
+ mixlib-log (1.4.1)
+ mixlib-shellout (1.1.0)
+ moneta (0.6.0)
+ net-ssh (2.2.2)
+ net-ssh-gateway (1.1.0)
+ net-ssh (>= 1.99.1)
+ net-ssh-multi (1.1)
+ net-ssh (>= 2.1.4)
+ net-ssh-gateway (>= 0.99.0)
+ ohai (6.14.0)
+ ipaddress
+ mixlib-cli
+ mixlib-config
+ mixlib-log
+ systemu
+ yajl-ruby
+ polyglot (0.3.3)
+ rest-client (1.6.7)
+ mime-types (>= 1.16)
+ systemu (2.5.2)
+ treetop (1.4.10)
+ polyglot
+ polyglot (>= 0.3.1)
+ uuidtools (2.1.3)
+ yajl-ruby (1.1.0)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ chef
@@ -0,0 +1,10 @@
+TDDing tmux
+===========
+This is the chef-repo for my TDDing tmux talk at #ChefSummit. This is the bare repo. If you want the post-talk repo, check out the `finished` branch.
+
+Cookbooks
+---------
+It starts with 2 cookbooks:
+
+- bluepill
+- database
@@ -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,19 @@
+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.
+
+Configure the values used in the SSL certificate by modifying `config/rake.rb`.
+
+To generate a certificate set for a new monitoring server, for example:
+
+ rake ssl_cert FQDN=monitoring.example.com
+
+Once the certificates are generated, copy them into the cookbook(s) where you want to use them.
+
+ cp certificates/monitoring.example.com.* cookbooks/COOKBOOK/files/default
+
+In the recipe for that cookbook, create a `cookbook_file` resource to configure a resource that puts them in place on the destination server.
+
+ cookbook_file '/etc/apache2/ssl/monitoring.example.com.pem'
+ owner 'root'
+ group 'root'
+ mode 0600
+ end
@@ -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,11 @@
+## v0.100.2:
+
+* [COOK-1568] - switch to chef_gem resource
+* [COOK-1426] - declare default actions for LWRPs
+
+## v0.100.0:
+
+* [COOK-1221] - convert node attribute accessors to strings
+* [COOK-1195] - manipulate AWS resource tags (instances, volumes,
+ snapshots
+* [COOK-627] - add aws_elb (elastic load balancer) LWRP
@@ -0,0 +1,29 @@
+If you would like to contribute, please open a ticket in JIRA:
+
+* http://tickets.opscode.com
+
+Create the ticket in the COOK project and use the cookbook name as the
+component.
+
+For all code contributions, we ask that contributors sign a
+contributor license agreement (CLA). Instructions may be found here:
+
+* http://wiki.opscode.com/display/chef/How+to+Contribute
+
+When contributing changes to individual cookbooks, please do not
+modify the version number in the metadata.rb. Also please do not
+update the CHANGELOG.md for a new version. Not all changes to a
+cookbook may be merged and released in the same versions. Opscode will
+handle the version updates during the release process. You are welcome
+to correct typos or otherwise make updates to documentation in the
+README.
+
+If a contribution adds new platforms or platform versions, indicate
+such in the body of the commit message(s), and update the relevant
+COOK ticket. When writing commit messages, it is helpful for others if
+you indicate the COOK ticket. For example:
+
+ git commit -m '[COOK-1041] Updated pool resource to correctly delete.'
+
+In the ticket itself, it is also helpful if you include log output of
+a successful Chef run, but this is not absolutely required.
Oops, something went wrong.

0 comments on commit 7b44c35

Please sign in to comment.