Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Manage and install Postgresql databases and users
Ruby Puppet D
Tag: v0.9.0
Fetching latest commit...
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

Puppet module for postgresql

Basic usage

To install the client software

class {'postgresql':  }

To specify a particular version

class {'postgresql':
    version => '9.1',

To install the server

class {'postgresql::server': }

Again, a particular version

class {'postgresql::server':
    version => '9.1',

Listen on a specific post / IP address

class {'postgresql::server':
    listen => ['', ],
    port   => 5432

Create a user

Actually this creates a role in the database cluster

pg_user {'pguser':
    password => 'pgpassword',
    ensure   => present,

Create a database

This creates a database and adds in a dependancy relationship to the user

pg_database {'pgdb':
    owner    => 'pguser',
    require  => Pg_user['pguser'],
    ensure   => present,

You can also specify both the locale and encoding of a database. The default, for English, should be fine though.

pg_database {'pgdb':
    owner    => 'pguser',
    encoding => 'UTF8',
    locale   => 'de_DE.UTF-8',
    require  => Pg_user['pguser'],
    ensure   => present,


Copyright and License

Copyright 2012 Linuxpeak Pty Ltd.

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see

Something went wrong with that request. Please try again.