Skip to content
This repository has been archived by the owner on May 21, 2018. It is now read-only.
/ chef-psql Public archive

A Chef cookbook that provides a set of LWRPs for interacting with postgres using the CLI.

License

Notifications You must be signed in to change notification settings

realityforge/chef-psql

Repository files navigation

Description

Build Status

A set of LWRPs for interacting with postgres using the CLI.

Dependencies

The cookbook requires the 'psql' client utility for postgres to be installed on the node. However there is no depedence on a cookbook that installs this utlility. One can be found here: https://github.com/opscode-cookbooks/postgresql.git

Requirements

Platform:

No platforms defined

Cookbooks:

  • cutlery (~> 0.1)

Attributes

No attributes defined

Recipes

No recipes defined

Resources

psql_database

Actions

  • create: Default action.
  • drop:
  • owner:

Attribute Parameters

  • host:
  • port: Defaults to 5432.
  • admin_username: Defaults to nil.
  • admin_password: Defaults to nil.
  • database:
  • owner:
  • encoding: Defaults to "DEFAULT".
  • template: Defaults to nil.
  • tablespace: Defaults to nil.
  • collation: Defaults to nil.
  • connection_limit: Defaults to nil.
  • bash_user: Defaults to "postgres".
  • bash_group: Defaults to "postgres".

psql_exec

Actions

  • run: Default action.

Attribute Parameters

  • command:
  • host:
  • port: Defaults to 5432.
  • admin_username: Defaults to nil.
  • admin_password: Defaults to nil.
  • dbname:
  • match: Defaults to nil.
  • returns: Defaults to 0.
  • bash_user: Defaults to "postgres".
  • bash_group: Defaults to "postgres".

psql_exec_file

Actions

  • run: Default action.

Attribute Parameters

  • command_file:
  • host:
  • port: Defaults to 5432.
  • admin_username: Defaults to nil.
  • admin_password: Defaults to nil.
  • dbname:
  • match: Defaults to nil.
  • returns: Defaults to 0.

psql_permission

Actions

  • grant: Default action.
  • revoke:

Attribute Parameters

  • host:
  • port: Defaults to 5432.
  • admin_username: Defaults to nil.
  • admin_password: Defaults to nil.
  • username:
  • database:
  • permissions:
  • bash_user: Defaults to "postgres".
  • bash_group: Defaults to "postgres".

psql_schema

Actions

  • grant_usage: Default action.

Attribute Parameters

  • host:
  • port: Defaults to 5432.
  • admin_username: Defaults to nil.
  • admin_password: Defaults to nil.
  • database:
  • schema:
  • username:
  • bash_user: Defaults to "postgres".
  • bash_group: Defaults to "postgres".

psql_user

Actions

  • create: Default action.
  • drop:

Attribute Parameters

  • host:
  • port: Defaults to 5432.
  • admin_username: Defaults to nil.
  • admin_password: Defaults to nil.
  • username:
  • password:
  • grant_create_db: Defaults to false.
  • grant_superuser: Defaults to false.
  • bash_user: Defaults to "postgres".
  • bash_group: Defaults to "postgres".

Usage

The cookbook is simply a set of LWRPs that you can use in your own cookbook. A simple example follows.

psql_user "myuser" do
  host node['fqdn']
  port node['postgresql']['config']['port']
  admin_username 'postgres'
  admin_password node['postgresql']['password']['postgres']
  password 'secret'
end

psql_database "mydatabase" do
  host node['fqdn']
  port node['postgresql']['config']['port']
  admin_username 'postgres'
  admin_password node['postgresql']['password']['postgres']
  owner 'myuser'
  template 'template_postgis'
  encoding 'DEFAULT'
  tablespace 'MyTablespace'
  collation 'fr_FR'
  connection_limit -1
end

psql_permission "myuser@mydatabase => all" do
  host node['fqdn']
  port node['postgresql']['config']['port']
  admin_username 'postgres'
  admin_password node['postgresql']['password']['postgres']
  username 'myuser'
  database 'mydatabase'
  permissions ['ALL']
end

License and Maintainer

Maintainer:: Peter Donald ([email protected])

Contributors::

  • André Hester

License:: Apache 2.0

About

A Chef cookbook that provides a set of LWRPs for interacting with postgres using the CLI.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages