Browse files

added postgresql cookbook

  • Loading branch information...
1 parent 0a7a151 commit 92dc5a3633bca4e4cd9d2a0044156214b9662610 @unlimit committed Mar 13, 2013
Showing with 2,023 additions and 0 deletions.
  1. BIN postgresql/.DS_Store
  2. +5 −0 postgresql/.gitignore
  3. +76 −0 postgresql/
  4. +257 −0 postgresql/
  5. +3 −0 postgresql/Gemfile
  6. +201 −0 postgresql/LICENSE
  7. +287 −0 postgresql/
  8. +413 −0 postgresql/attributes/default.rb
  9. +27 −0 postgresql/files/default/tests/minitest/default_test.rb
  10. +35 −0 postgresql/files/default/tests/minitest/ppa_pitti_postgresql_test.rb
  11. +28 −0 postgresql/files/default/tests/minitest/ruby_test.rb
  12. +43 −0 postgresql/files/default/tests/minitest/server_test.rb
  13. +29 −0 postgresql/files/default/tests/minitest/support/helpers.rb
  14. +23 −0 postgresql/metadata.rb
  15. +34 −0 postgresql/recipes/client.rb
  16. +24 −0 postgresql/recipes/contrib.rb
  17. +20 −0 postgresql/recipes/default.rb
  18. +10 −0 postgresql/recipes/ppa_pitti_postgresql.rb
  19. +101 −0 postgresql/recipes/ruby.rb
  20. +81 −0 postgresql/recipes/server.rb
  21. +34 −0 postgresql/recipes/server_debian.rb
  22. +55 −0 postgresql/recipes/server_redhat.rb
  23. +60 −0 postgresql/recipes/yum_pgdg_postgresql.rb
  24. +10 −0 postgresql/templates/default/pg_hba.conf.erb
  25. +20 −0 postgresql/templates/default/postgresql.conf.erb
  26. +10 −0 postgresql/test/kitchen/Kitchenfile
  27. +1 −0 postgresql/test/kitchen/cookbooks/postgresql_test/
  28. +1 −0 postgresql/test/kitchen/cookbooks/postgresql_test/attributes/default.rb
  29. +5 −0 postgresql/test/kitchen/cookbooks/postgresql_test/metadata.rb
  30. +20 −0 postgresql/test/kitchen/cookbooks/postgresql_test/recipes/contrib.rb
  31. +20 −0 postgresql/test/kitchen/cookbooks/postgresql_test/recipes/default.rb
  32. +24 −0 postgresql/test/kitchen/cookbooks/postgresql_test/recipes/ppa_pitti_postgresql.rb
  33. +20 −0 postgresql/test/kitchen/cookbooks/postgresql_test/recipes/ruby.rb
  34. +22 −0 postgresql/test/kitchen/cookbooks/postgresql_test/recipes/server.rb
  35. +24 −0 postgresql/test/kitchen/cookbooks/postgresql_test/recipes/yum_pgdg_postgresql.rb
Binary file not shown.
@@ -0,0 +1,5 @@
@@ -0,0 +1,76 @@
+## v2.2.2:
+* [COOK-2232] -Provide PGDG yum repo to install postgresql 9.x on
+ redhat-derived distributions
+## v2.2.0:
+* [COOK-2230] - Careful about Debian minor version numbers
+* [COOK-2231] - Fix support for postgresql 9.x in server_redhat recipe
+* [COOK-2238] - Postgresql recipe error in password check
+* [COOK-2176] - PostgreSQL cookbook in Solo mode can cause
+ "NoMethodError: undefined method `[]' for nil:NilClass"
+* [COOK-2233] - Provide postgresql::contrib recipe to install useful
+ server administration tools
+## v2.1.0:
+* [COOK-1872] - Allow latest PostgreSQL deb packages to be installed
+* [COOK-1961] - Postgresql config file changes with every Chef run
+* [COOK-2041] - Postgres cookbook no longer installs on OpenSuSE 11.4
+## v2.0.2:
+* [COOK-1406] - pg gem compile is unable to find libpq under Chef full
+ stack (omnibus) installation
+## v2.0.0:
+This version is backwards incompatible with previous versions of the
+cookbook due to use of `platform_family`, and the refactored
+configuration files using node attributes. See for details
+on how to modify configuration of PostgreSQL.
+* [COOK-1508] - fix mixlib shellout error on SUSE
+* [COOK-1744] - Add service enable & start
+* [COOK-1779] - Don't run apt-get update and others in ruby recipe if pg is installed
+* [COOK-1871] - Attribute driven configuration files for PostgreSQL
+* [COOK-1900] - don't assume ssl on all postgresql 8.4+ installs
+* [COOK-1901] - fail a chef-solo run when the postgres password
+ attribute is not set
+## v1.0.0:
+**Important note for this release**
+This version no longer installs Ruby bindings in the client recipe by
+default. Use the ruby recipe if you'd like the RubyGem. If you'd like
+packages for your distribution, use them in your application's
+specific cookbook/recipe, or modify the client packages attribute.
+This resolves the following tickets.
+* COOK-1011
+* COOK-1534
+The following issues are also resolved with this release.
+* [COOK-1011] - Don't install postgresql packages during compile
+ phase and remove pg gem installation
+* [COOK-1224] - fix undefined variable on Debian
+* [COOK-1462] - Add attribute for specifying listen address
+## v0.99.4:
+* [COOK-421] - config template is malformed
+* [COOK-956] - add make package on ubuntu/debian
+## v0.99.2:
+* [COOK-916] - use < (with float) for version comparison.
+## v0.99.0:
+* Better support for Red Hat-family platforms
+* Integration with database cookbook
+* Make sure the postgres role is updated with a (secure) password
@@ -0,0 +1,257 @@
+# Contributing to Opscode Cookbooks
+We are glad you want to contribute to Opscode Cookbooks! The first
+step is the desire to improve the project.
+You can find the answers to additional frequently asked questions
+[on the wiki](
+You can find additional information about
+[contributing to cookbooks](
+on the wiki as well.
+## Quick-contribute
+* Create an account on our [bug tracker](
+* Sign our contributor agreement (CLA)
+[ online](
+(keep reading if you're contributing on behalf of your employer)
+* Create a ticket for your change on the
+ [bug tracker](
+* Link to your patch as a rebased git branch or pull request from the
+ ticket
+* Resolve the ticket as fixed
+We regularly review contributions and will get back to you if we have
+any suggestions or concerns.
+## The Apache License and the CLA/CCLA
+Licensing is very important to open source projects, it helps ensure
+the software continues to be available under the terms that the author
+desired. Chef uses the Apache 2.0 license to strike a balance between
+open contribution and allowing you to use the software however you
+would like to.
+The license tells you what rights you have that are provided by the
+copyright holder. It is important that the contributor fully
+understands what rights they are licensing and agrees to them.
+Sometimes the copyright holder isn't the contributor, most often when
+the contributor is doing work for a company.
+To make a good faith effort to ensure these criteria are met, Opscode
+requires a Contributor License Agreement (CLA) or a Corporate
+Contributor License Agreement (CCLA) for all contributions. This is
+without exception due to some matters not being related to copyright
+and to avoid having to continually check with our lawyers about small
+It only takes a few minutes to complete a CLA, and you retain the
+copyright to your contribution.
+You can complete our contributor agreement (CLA)
+[ online](
+If you're contributing on behalf of your employer, have your employer
+fill out our
+[Corporate CLA](
+## Ticket Tracker (JIRA)
+The [ticket tracker]( is the most important
+documentation for the code base. It provides significant historical
+information, such as:
+* Which release a bug fix is included in
+* Discussion regarding the design and merits of features
+* Error output to aid in finding similar bugs
+Each ticket should aim to fix one bug or add one feature.
+## Using git
+You can get a quick copy of the repository for this cookbook by
+running `git clone
+For collaboration purposes, it is best if you create a Github account
+and fork the repository to your own account. Once you do this you will
+be able to push your changes to your Github repository for others to
+see and use.
+If you have another repository in your GitHub account named the same
+as the cookbook, we suggest you suffix the repository with -cookbook.
+### Branches and Commits
+You should submit your patch as a git branch named after the ticket,
+such as COOK-1337. This is called a _topic branch_ and allows users to
+associate a branch of code with the ticket.
+It is a best practice to have your commit message have a _summary
+line_ that includes the ticket number, followed by an empty line and
+then a brief description of the commit. This also helps other
+contributors understand the purpose of changes to the code.
+ [COOK-1757] - platform_family and style
+ * use platform_family for platform checking
+ * update notifies syntax to "resource_type[resource_name]" instead of
+ resources() lookup
+ * COOK-692 - delete config files dropped off by packages in conf.d
+ * dropped debian 4 support because all other platforms have the same
+ values, and it is older than "old stable" debian release
+Remember that not all users use Chef in the same way or on the same
+operating systems as you, so it is helpful to be clear about your use
+case and change so they can understand it even when it doesn't apply
+to them.
+### Github and Pull Requests
+All of Opscode's open source cookbook projects are available on
+We don't require you to use Github, and we will even take patch diffs
+attached to tickets on the tracker. However Github has a lot of
+convenient features, such as being able to see a diff of changes
+between a pull request and the main repository quickly without
+downloading the branch.
+If you do choose to use a pull request, please provide a link to the
+pull request from the ticket __and__ a link to the ticket from the
+pull request. Because pull requests only have two states, open and
+closed, we can't easily filter pull requests that are waiting for a
+reply from the author for various reasons.
+### More information
+Additional help with git is available on the
+[Working with Git](
+wiki page.
+## Functional and Unit Tests
+This cookbook is set up to run tests under
+[Opscode's test-kitchen]( It
+uses minitest-chef to run integration tests after the node has been
+converged to verify that the state of the node.
+Test kitchen should run completely without exception using the default
+[baseboxes provided by Opscode](
+Because Test Kitchen creates VirtualBox machines and runs through
+every configuration in the Kitchenfile, it may take some time for
+these tests to complete.
+If your changes are only for a specific recipe, run only its
+configuration with Test Kitchen. If you are adding a new recipe, or
+other functionality such as a LWRP or definition, please add
+appropriate tests and ensure they run with Test Kitchen.
+If any don't pass, investigate them before submitting your patch.
+Any new feature should have unit tests included with the patch with
+good code coverage to help protect it from future changes. Similarly,
+patches that fix a bug or regression should have a _regression test_.
+Simply put, this is a test that would fail without your patch but
+passes with it. The goal is to ensure this bug doesn't regress in the
+future. Consider a regular expression that doesn't match a certain
+pattern that it should, so you provide a patch and a test to ensure
+that the part of the code that uses this regular expression works as
+expected. Later another contributor may modify this regular expression
+in a way that breaks your use cases. The test you wrote will fail,
+signalling to them to research your ticket and use case and accounting
+for it.
+If you need help writing tests, please ask on the Chef Developer's
+mailing list, or the #chef-hacking IRC channel.
+## Code Review
+Opscode regularly reviews code contributions and provides suggestions
+for improvement in the code itself or the implementation.
+We find contributions by searching the ticket tracker for _resolved_
+tickets with a status of _fixed_. If we have feedback we will reopen
+the ticket and you should resolve it again when you've made the
+changes or have a response to our feedback. When we believe the patch
+is ready to be merged, we will tag the _Code Reviewed_ field with
+Depending on the project, these tickets are then merged within a week
+or two, depending on the current release cycle.
+## Release Cycle
+The versioning for Opscode Cookbook projects is X.Y.Z.
+* X is a major release, which may not be fully compatible with prior
+ major releases
+* Y is a minor release, which adds both new features and bug fixes
+* Z is a patch release, which adds just bug fixes
+A released version of a cookbook will end in an even number, e.g.
+"1.2.4" or "0.8.0". When development for the next version of the
+cookbook begins, the "Z" patch number is incremented to the next odd
+number, however the next release of the cookbook may be a major or
+minor incrementing version.
+Releases of Opscode's cookbooks are usually announced on the Chef user
+mailing list. Releases of several cookbooks may be batched together
+and announced on the [Opscode Blog](
+## Working with the community
+These resources will help you learn more about Chef and connect to
+other members of the Chef community:
+* [chef]( and
+ [chef-dev]( mailing
+ lists
+* #chef and #chef-hacking IRC channels on
+* [Community Cookbook site](
+* [Chef wiki](
+* Opscode Chef [product page](
+## Cookbook Contribution Do's and Don't's
+Please do include tests for your contribution. If you need help, ask
+on the
+[chef-dev mailing list](
+or the
+[#chef-hacking IRC channel](
+Not all platforms that a cookbook supports may be supported by Test
+Kitchen. Please provide evidence of testing your contribution if it
+isn't trivial so we don't have to duplicate effort in testing. Chef
+10.14+ "doc" formatted output is sufficient.
+Please do indicate new platform (families) or platform versions in the
+commit message, and update the relevant ticket.
+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.'
+Please do use [foodcritic]( to
+lint-check the cookbook. Except FC007, it should pass all correctness
+rules. FC007 is okay as long as the dependent cookbooks are *required*
+for the default behavior of the cookbook, such as to support an
+uncommon platform, secondary recipe, etc.
+Please do ensure that your changes do not break or modify behavior for
+other platforms supported by the cookbook. For example if your changes
+are for Debian, make sure that they do not break on CentOS.
+Please do not modify the version number in the metadata.rb, Opscode
+will select the appropriate version based on the release cycle
+information above.
+Please do not update the for a new version. Not all
+changes to a cookbook may be merged and released in the same versions.
+Opscode will update the when releasing a new version of
+the cookbook.
@@ -0,0 +1,3 @@
+source :rubygems
+gem 'test-kitchen', '<= 1.0'
Oops, something went wrong.

0 comments on commit 92dc5a3

Please sign in to comment.