Git Product home page Git Product logo

postgresql's Introduction

Description

Installs and configures PostgreSQL as a client or a server.

Requirements

Platforms

  • Debian, Ubuntu
  • Red Hat/CentOS/Scientific (6.0+ required) - "EL6-family"
  • Fedora
  • SUSE

Tested on:

  • Ubuntu 10.04, 11.10, 12.04
  • Red Hat 6.1, Scientific 6.1, CentOS 6.3

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 in the ruby recipe.

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 database.

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.

  • node['postgresql']['client']['packages'] - An array of package names that should be installed on "client" systems.

  • node['postgresql']['server']['packages'] - An array of package names that should be installed on "server" systems.

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.

ruby

NOTE This recipe does not currently work when installing Chef with the "Omnibus" full stack installer due to an incompatibility with OpenSSL. See COOK-1406

Install the pg gem under Chef's Ruby environment so it can be used in other recipes.

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 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].

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 ([email protected]) Author:: Lamont Granquist ([email protected])

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.

postgresql's People

Contributors

gregkare avatar fnichol avatar nathenharvey avatar brynary avatar btm avatar chewi avatar sfiggins avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.