crvidya / chef-psql

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Description

Build Status

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

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:

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.

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.

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:

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.

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 (peter@realityforge.org)

License:: Apache 2.0

About

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

License:Apache License 2.0


Languages

Language:Ruby 100.0%