fuel-library/deployment/puppet/postgresql
Andrey Korolyov d353740465 Cleanup for file modes
Change-Id: I8b8390949680dff1f862a1747fdac57afdc10d57
2013-12-19 02:50:19 +04:00
..
lib/puppet/parser/functions Remove postgresql_version fact that slows down facter 2013-10-18 15:55:45 +04:00
manifests Fix typo in psql 2012-11-23 18:37:04 +04:00
spec Cleanup for file modes 2013-12-19 02:50:19 +04:00
templates Initial commit 2012-10-22 16:41:23 +04:00
tests Initial commit 2012-10-22 16:41:23 +04:00
.gitignore Ignore metadata.json 2013-01-11 14:09:25 +04:00
.project Add project files 2013-01-10 18:37:05 +04:00
CHANGELOG.md Initial commit 2012-10-22 16:41:23 +04:00
LICENSE Initial commit 2012-10-22 16:41:23 +04:00
Modulefile Fix eclipse build 2013-03-01 04:39:21 +04:00
README.md Initial commit 2012-10-22 16:41:23 +04:00

Puppet module for PostgreSQL resources

This module provides the following defined resource types for managing postgres:

  • postgresql::initdb
  • postgresql::db
  • postgresql::role
  • postgresql::user (just for clarity; users are roles in postgres)
  • postgresql::grant

And the fallback, analogous to exec resources, only for SQL statements:

  • postgresql::psql

Basic usage

postgresql::user{'marmot':
    password => 'foo',
}

postgresql::grant{'grant select to marmot':
   grantee   => 'marmot',
   on_object => 'my_table',
   perm      => 'select',
   require   => Postgresql::User['marmot'],
}

etc, etc.

Automated testing

Install and setup an RVM with vagrant, sahara, and rspec

$ curl -L get.rvm.io | bash -s stable
$ rvm install 1.9.3
$ rvm use --create 1.9.3@puppet-postgresql
$ gem install vagrant sahara rspec

Run the tests like so:

$ (cd spec; vagrant up)
$ rspec -f -d -c

The test suite will snapshot the VM and rollback between each test.

Next, take a look at the manifests used for the automated tests.

spec/
    manifests/
        test_*.pp

Contributors

Copyright 2012 Inkling Systems, Inc.

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.