Commit graph

120 commits

Author SHA1 Message Date
Mickaël Canévet
abf8f64ab5 Alter superuser, createdb, createrole, login, replication status and the connection limit of a role that already exists
Previously we only created a new user, any updates to the defined resource
would not update the role. This patch adds extra logic to modify a role
whenever a parameter is changed.

System tests have also been added to support this.
2013-07-03 14:11:54 +01:00
Chris Price
dcac94a70d Merge pull request #156 from harbulot/issue_114
Setting the owner of the database with createdb.
2013-06-06 14:45:07 -07:00
Chris Price
5bc584ef26 Merge pull request #188 from cprice-puppet/bug/master/fix-hard-coded-postgres-user-in-hba
Don't hard-code postgres user's username for pg_hba
2013-06-06 14:43:02 -07:00
Chris Price
8502de54a7 Don't hard-code postgres user's username for pg_hba 2013-06-06 12:55:43 -07:00
Ken Barber
f6fb18a5b3 Fix up and add some tests for unknown OS patch
This patch just adds some new tests for the unknown OS patch, and cleans up
some existing tests to look for the new warning message.

Also, change the warning message for $osfamily and manage_package_repo to
reflect the parameter at fault.

Signed-off-by: Ken Barber <ken@bob.sh>
2013-06-06 20:53:36 +01:00
Chris Price
6bd2befa98 Add support for other operating systems besides Redhat/Debian
Prior to this commit, if you attempted to use the module to
manage postgres on any OS other than Redhat/Debian, there
was an explicit check for that, and a call to `fail`.

In reality, the OS family is only used to build up defaults
for various path and package names, which are all exposed
as parameters.  If the user is willing to explicitly pass
in all of those parameters, there's no reason we should
fail based on OS family.

This commit adds checks to the 'default' osfamily case
such that we now only fail if they're on a non-Redhat-or-Debian
system *and* they haven't explicitly passed in values for
all of the required parameters.
2013-06-06 12:23:30 -07:00
Ken Barber
80c85e8f2b Convert system tests to use rspec-system
This patch ports all of the existing system tests to use rspec-system instead.

To assist with this conversion some patches were made to fix OS compatibility
where necessary. We also added an ensure parameter to the postgresql::server
class to assist with removing PostgreSQL configuration to aid with testing
cleanups.

The documentation has been updated to indicate test usage with rspec-system,
we've also renamed the 'tests' directory to 'examples'.

Signed-off-by: Ken Barber <ken@bob.sh>
2013-06-04 15:36:24 +01:00
Dan Prince
03b3df3ab9 Add test on postgresql::python. 2013-04-22 11:30:07 -04:00
Flaper Fesp
bd9bcf4cc2 Add support for psycopg installation 2013-04-22 11:07:50 -04:00
Flaper Fesp
9a307d986a Add support for psycopg installation 2013-04-22 11:04:01 -04:00
Ken Barber
5e4045d0c9 Merge pull request #158 from harbulot/user_nopassword
Adding the ability to create users without a password.
2013-04-12 12:08:49 -07:00
Ken Barber
3804c9323c Merge pull request #162 from domcleal/pp26-fixes
Three Puppet 2.6 fixes
2013-03-27 04:21:06 -07:00
Dominic Cleal
4b5212f803 Enable hasstatus for EL and Puppet 2.6, to detect running server 2013-03-21 18:13:17 +00:00
Dominic Cleal
a8b382276a Change connection_limit default to string, Puppet 2.6 can't parse negative ints 2013-03-21 18:13:05 +00:00
Dominic Cleal
1dd687c882 Add explicit call to concat::setup when creating concat file 2013-03-21 10:13:43 +00:00
Bruno Harbulot
dd05232177 Adding the ability to create users without a password. 2013-03-16 17:32:27 +00:00
Bruno Harbulot
33c56e97ef Setting the owner of the database with createdb. 2013-03-16 16:23:51 +00:00
Kamil Szymanski
82ce5d0480 Add documentation, rspec test and support for global overriding contrib package name 2013-03-02 10:49:57 +01:00
Kamil Szymanski
c6aec41f1b Add supprot for contrib package 2013-03-02 10:46:34 +01:00
Ken Barber
78e183c43b Merge pull request #142 from kamilszymanski/connection_limit
Allow to set connection limit for new role
2013-03-01 06:32:22 -08:00
Kamil Szymanski
e7b25d6b29 Allow to set connection limit for new role 2013-02-28 00:43:24 +01:00
Kamil Szymanski
7a8f7ace59 fix pg_hba_rule for postgres local access 2013-02-27 12:14:13 +01:00
Ken Barber
794ef22934 Fix versions for travis-ci
This fixes some mistakes in the .travis.yml file:

* Corrects matches so the minor gem revisions get rounded, this means 2.6.0
  for example is used.
* Adds Ruby 2.0.0 tests
* Allows 2.6.0 to fail for now, as it doesn't have create_resources.
* Removes trailing commas and arrays in functions for 2.6.0.

Signed-off-by: Ken Barber <ken@bob.sh>
2013-02-26 14:32:25 +00:00
Jordi Boggiano
49ecb872fa Add support for the REPLICATION flag when creating roles 2013-02-25 19:11:28 +01:00
Ken Barber
501289394a Cleaned up and added unit tests
Signed-off-by: Ken Barber <ken@bob.sh>
2013-02-25 17:50:53 +00:00
Karel Brezina
5ef164b1a6 Generalization to provide more flexibility in postgresql configuration 2013-02-25 17:50:34 +00:00
Michael Arnold
0db0849054 Drop trailing comma to support Puppet 2.6. 2013-02-23 16:09:26 -07:00
Ken Barber
4d70c188e8 (GH-130) Fix 'include' parameter for Postgresql 8.1
This removes the 'include' parameter for PostgreSQL 8.1 as it was failing on
Centos 5.

Also added Centos 5 system tests using our new Vagrant boxes.

Signed-off-by: Ken Barber <ken@bob.sh>
2013-02-21 19:17:04 +00:00
Erik Dalén
6322aff0e8 don't modify variables 2013-02-15 17:19:31 +00:00
Erik Dalén
23368ffb03 fix lots of style issues 2013-02-15 17:22:52 +01:00
Ken Barber
b9db279c04 Do not run the reload of postgresql as postgresql
While this worked fine in Ubuntu, it failed silently in Centos.

The script is really designed to be ran as root, so removing the user
property. This was failing our new pg_hba_rule tests without it.

Signed-off-by: Ken Barber <ken@bob.sh>
2013-02-12 00:34:44 +00:00
Ken Barber
86a0453f2f Provide new defined resources for managing pg_hba.conf
This patch provides a more advanced way of managing pg_hba rules, by providing a
defined resource to manage a pg_hba file, and a defined resource for managing
rules within such a file (pg_hba_rule).

These new resources are wrappers around ripinaar-concat, and utilise file
assemblies instead of a template to compose the pg_hba.conf file.

I've provided a function that interprets the old ip4|6acl arrays and converts
them to this new format for backwards compatibility as well.

I slightly reformatted our documentation to allow for better documentation of
defined resources in 'Usage' as well, and provided examples of how to use this
new resource.

This hopefully should go a long way to solving the PR's related to lack of full
functionality for pg_hba.conf.

Signed-off-by: Ken Barber <ken@bob.sh>
2013-02-12 00:34:42 +00:00
fhrbek
e29e0c0d58 Reverted some of the coding style fixes. Strings containing single quotes may be easier to read if enclosed in double quotes although it generated puppet lint warning. 2013-02-07 10:51:33 +01:00
Ken Barber
39862106b2 Merge pull request #117 from fhrbek/coding_style
Coding style fixes
2013-02-06 14:32:39 -08:00
fhrbek
10cb81468e Coding style fixes 2013-02-06 18:51:58 +01:00
Michael Arnold
bbe92fbc1b Clean up java.pp manifest documentation.
Also clarify postgresql::java rspec test.
2013-02-05 23:22:27 -07:00
Michael Arnold
556ab32b73 Add support for JDBC connector.
Modify params.pp to abstract the package name for the postgresql JDBC
connector and add Class['postgresql::java'].  Also update the README.md
to mention the availability of this class.
2013-02-05 23:22:13 -07:00
Ken Barber
2114333539 Add locale parameter support
This adds the parameter 'locale' to the 'postgresql' class so we have a global
default, and adds it two the defined resources 'postgresql::db' and
'postgresql::database'. This allows users to either:

* Defined a global default for the cluster
* Define a per-database default

As a side-effect I had to make sure 'charset' was also exposed in a similar
manner as some locales need a particular charset to work.

Tests were added to test both the 'createdb' case and 'initdb' case for Redhat,
and some refactoring was done to make the existing non_default test area use
heredocs so my manifests and test code was kept close together. As apposed to
entirely different files and places in the directory structure.

I cleaned up the related execs a little bit, adding logoutput => on_failure
where needed so we can debug failures. Beforehand execs just 'failed', but
now we should be able to get better feedback from failed execs helping support.

I also add intention comments in parts of the Puppet code that I touched where
it made sense.

Signed-off-by: Ken Barber <ken@bob.sh>
2013-02-05 17:23:52 +00:00
Karel Brezina
236ce4783a Added info about the advanced configuration file 2013-02-01 12:46:59 +01:00
Chris Price
a4ec366811 WIP - adding support for an 'included' config file 2013-01-31 15:56:48 +01:00
Karel Brezina
9114490e9d Tablespacing improvements 2013-01-29 14:05:15 +01:00
Karel Brezina
fad93fbeea Added support for tablespaces 2013-01-28 18:01:11 +01:00
Flaper Fesp
219e7445bd Removed trailing comma. Makes puppet fail 2013-01-18 15:58:47 +01:00
Chris Price
43ded429de Fix revoke command in database.pp to support postgres 8.1
In postgres 8.1, the 'CONNECT' privilege doesn't exist, which
would result in an error if you tried to use the 'database'
type.  This commit conditions the revoke statement to use the
'ALL' privilege on 8.1.
2013-01-16 16:38:24 -08:00
Daniel Pittman
a018be54e7 Merge pull request #79 from Seldaek/patch-2
Add support for ubuntu 12.10 status
2013-01-16 10:17:19 -08:00
Chris Price
1d6ad0ce9b Update CHANGELOG, README, Modulefile for 2.0.0 release 2013-01-15 16:09:10 -08:00
Chris Price
a1d0ef75f0 Add a "require" to make sure the service is up before trying to create a db 2013-01-15 14:43:18 -08:00
Jordi Boggiano
3504405cf0 Add support for ubuntu 12.10 status 2013-01-15 23:31:14 +01:00
Ken Barber
faeac44713 Manage official postgres apt repo
Previously we hadn't supported using the official PostgreSQL repos for deb-based
packaging. This commit fixes that by introducing the management of the apt
repositories on the host as required, and using the correct package and service
name.

Signed-off-by: Ken Barber <ken@bob.sh>
2013-01-15 11:00:24 -08:00
Chris Price
5f705ddf32 Fix merge issue from AMZ linux patch 2013-01-14 14:14:10 -08:00