A set of LWRPs for interacting with postgres using the CLI.
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
No platforms defined
- cutlery (~> 0.1)
No attributes defined
No recipes defined
- create: Default action.
- drop:
- owner:
- 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"
.
- run: Default action.
- 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"
.
- run: Default action.
- 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
.
- grant: Default action.
- revoke:
- 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"
.
- grant_usage: Default action.
- 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"
.
- create: Default action.
- drop:
- 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"
.
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
Maintainer:: Peter Donald (peter@realityforge.org)
Contributors::
- André Hester
License:: Apache 2.0