Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

postgresql v0.99.0, and move README from .rdoc to .md

  • Loading branch information...
commit 78239016ee0fed163d1de6e02a5213ae09178cf2 1 parent ec0cbf6
@jtimberman jtimberman authored
Showing with 156 additions and 57 deletions.
  1. +146 −0 postgresql/README.md
  2. +0 −50 postgresql/README.rdoc
  3. +10 −7 postgresql/metadata.rb
View
146 postgresql/README.md
@@ -0,0 +1,146 @@
+Description
+===========
+
+Installs and configures PostgreSQL as a client or a server.
+
+Changes/Roadmap
+==============
+
+## v 0.99.0
+
+* Better support for Red Hat-family platforms
+* Integration with database cookbook
+* Make sure the postgres role is updated with a (secure) password
+
+Requirements
+============
+
+## Platforms
+
+* Debian, Ubuntu
+* Red Hat/CentOS/Scientific (6.0+ required) - "EL6-family"
+* Fedora
+* SUSE
+
+Tested on:
+
+* Ubuntu 10.04, 11.10
+* Red Hat 6.1, Scientific 6.1
+
+## Cookboooks
+
+Requires Opscode's `openssl` cookbook for secure password generation.
+
+Requires a C compiler and development headers in order to build the
+`pg` RubyGem to provide Ruby bindings so they're available in other
+cookbooks.
+
+Opscode's `build-essential` cookbook provides this functionality on
+Debian, Ubuntu, and EL6-family.
+
+While not required, Opscode's `database` cookbook contains resources
+and providers that can interact with a PostgreSQL database. This
+cookbook is a dependency of that one.
+
+Attributes
+==========
+
+The following attributes are set based on the platform, see the
+`attributes/default.rb` file for default values.
+
+* `node['postgresql']['version']` - version of postgresql to manage
+* `node['postgresql']['dir']` - home directory of where postgresql
+ data and configuration lives.
+
+The following attributes are generated in
+`recipe[postgresql::server]`.
+
+* `node['postgresql']['password']['postgres']` - randomly generated
+ password by the `openssl` cookbook's library.
+* `node['postgresql']['ssl']` - whether to enable SSL (off for version
+ 8.3, true for 8.4).
+
+Recipes
+=======
+
+default
+-------
+
+Includes the client recipe.
+
+client
+------
+
+Installs postgresql client packages and development headers during the
+compile phase. Also installs the `pg` Ruby gem during the compile
+phase so it can be made available for the `database` cookbook's
+resources, providers and libraries.
+
+server
+------
+
+Includes the `server_debian` or `server_redhat` recipe to get the
+appropriate server packages installed and service managed. Also
+manages the configuration for the server:
+
+* generates a strong default password (via `openssl`) for `postgres`
+* sets the password for postgres
+* manages the `pg_hba.conf` file.
+
+server\_debian
+--------------
+
+Installs the postgresql server packages, manages the postgresql
+service and the postgresql.conf file.
+
+server\_redhat
+--------------
+
+Manages the postgres user and group (with UID/GID 26, per RHEL package
+conventions), installs the postgresql server packages, initializes the
+database and manages the postgresql service, and manages the
+postgresql.conf file.
+
+Resources/Providers
+===================
+
+See the [database](http://community.opscode.com/cookbooks/database)
+for resources and providers that can be used for managing PostgreSQL
+users and databases.
+
+Usage
+=====
+
+On systems that need to connect to a PostgreSQL database, add to a run
+list `recipe[postgresql]` or `recipe[postgresql::client]`.
+
+This does install the `pg` RubyGem, which has native C extensions, so
+that the resources and providers can be used in the `database`
+cookbook, or elsewhere in the same Chef run. Use Opscode's
+`build-essential` cookbook to make sure the proper build tools are
+installed so the C extensions can be compiled.
+
+On systems that should be PostgreSQL servers, use
+`recipe[postgresql::server]` on a run list. This recipe does set a
+password and expect to use it. It performs a node.save when Chef is
+not running in `solo` mode. If you're using `chef-solo`, you'll need
+to set the attribute `node['postgresql']['password']['postgres']` in
+your node's `json_attribs` file or in a role.
+
+License and Author
+==================
+
+Author:: Joshua Timberman (<joshua@opscode.com>)
+Author:: Lamont Granquist (<lamont@opscode.com>)
+
+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.
View
50 postgresql/README.rdoc
@@ -1,50 +0,0 @@
-= DESCRIPTION:
-
-Installs and configures postgresql client or server.
-
-= REQUIREMENTS:
-
-== Platform:
-
-Tested on CentOS 5.5, Ubuntu 10.04 but should support centos, redhat, fedora, suse, ubuntu and debian.
-
-== Cookbooks:
-
-= ATTRIBUTES:
-
-* postgresql[:dir] - configuration file location.
-* postgresql[:version] - Version of postgresql to use. Configured in attributes based on platform.
-* postgresql[:ssl] - used on debian family installs to enable ssl support. The debian post installation script automatically builds the certificates.
-
-= USAGE:
-
-For clients:
-
- include_recipe "postgresql::client"
-
-For server:
-
- include_recipe "postgresql::server"
-
-(client is already included by server). This will check the platform that the node is and include either redhat family recipe (postgresql::server_redhat) or debian family (postgresql::server_debian) because the two styles differ quite a bit.
-
-The templates provided by this cookbook will probably need to be tweaked for the local environment, no tuning parameters are specified in them. The templates are separated by family designation in the template directory, since Chef doesn't do "platform family" style file specificity.
-
-= LICENSE and AUTHOR:
-
-Author:: Joshua Timberman (<joshua@opscode.com>)
-Author:: Lamont Granquist (<lamont@opscode.com>)
-
-Copyright:: 2009-2010, 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.
View
17 postgresql/metadata.rb
@@ -2,17 +2,20 @@
maintainer_email "cookbooks@opscode.com"
license "Apache 2.0"
description "Installs and configures postgresql for clients or servers"
-long_description IO.read(File.join(File.dirname(__FILE__), 'README.rdoc'))
-version "0.11.1"
-recipe "postgresql", "Empty, use one of the other recipes"
+long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
+version "0.99.0"
+recipe "postgresql", "Includes postgresql::client"
recipe "postgresql::client", "Installs postgresql client package(s)"
recipe "postgresql::server", "Installs postgresql server packages, templates"
-recipe "postgresql::redhat", "Installs postgresql server packages, redhat family style"
-recipe "postgresql::server", "Installs postgresql server packages, debian family style"
+recipe "postgresql::server_redhat", "Installs postgresql server packages, redhat family style"
+recipe "postgresql::server_debian", "Installs postgresql server packages, debian family style"
-%w{rhel centos fedora ubuntu debian suse scientific}.each do |os|
+%w{ ubuntu debian fedora suse }.each do |os|
supports os
end
-depends "openssl"
+%w{redhat centos scientific}.each do |el|
+ supports el, ">= 6.0"
+end
+depends "openssl"
Please sign in to comment.
Something went wrong with that request. Please try again.