Commit graph

13 commits

Author SHA1 Message Date
fiddyspence
2eb03efc29 Alter escaping in postgresql::config::afterservice
This allows non-standard users (pe-postgres) to change passwords. Also
added a function to do escaping of the password, added system tests
and rspec tests for the function.
2013-07-23 13:04:46 +01:00
Hunter Haugen
6890a56eb7 Reindent postgresql::database_grant spec 2013-07-16 14:31:28 -07:00
Hunter Haugen
a37eaa053b Split database_grant up
The code to grant permissions databases and their objects has been
abstracted to `postgresql::grant` and is used by both
`postgresql::database_grant` and `postgresql::table_grant`
2013-07-16 14:31:28 -07:00
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
Ken Barber
2676904608 Fix the non-defaults test failing to use UTF8
The non-default tests try to set UTF8 when UTF8 is not installed on the en_US
machine. These are non-default settings anyway, but one should presume the
correct locale should be set before this is attempted, this patch includes
that step.

In an ideal world we would use a locale module to do this.

This patch also fixes an Ubuntu 10.04 issue where you need to be absolute about
the locale and encoding as well.

Signed-off-by: Ken Barber <ken@bob.sh>
2013-06-14 23:14:47 +01: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
Ken Barber
abc63627d5 Create dependent directory for sudoers so tests work on Centos 5
Signed-off-by: Ken Barber <ken@bob.sh>
2013-02-25 16:51:20 +00:00
Ken Barber
0a76406e23 (GH-130) Amend system tests for Centos 5
Skip tests that don't apply to Centos 5, and make sure the parent directory
for tablespace correction has the correct SELinux settings for tablespace
management.

Signed-off-by: Ken Barber <ken@bob.sh>
2013-02-21 21:23:56 +00: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
Ken Barber
39f30eb886 Fix module file, remove extra README.md and fix some docs
The module file had the wrong revision in it for starters. And there was some
missing items from the .gitignore.

The extra README.md in spec/system was getting extracted as the main README
on the forge so I remove it, moving the content that was not duplicated
already into README.md.

I took the opportunity also to finish the documentation in the Reference
section of the README to make sure all classes and defined resources are
documented.

Signed-off-by: Ken Barber <ken@bob.sh>
2013-02-20 13:47:10 +00:00
fhrbek
10cb81468e Coding style fixes 2013-02-06 18:51:58 +01: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
Ken Barber
e9370fee7b Add unit tests and travis-ci support
This patch includes some very basic and initial unit testing using rspec-puppet
and for the case of facts, just normal rspec.

I've taken a very light approach here as rspec-puppet can be quite combinatorial
when one gets carried away. For now I've just added basic compile failure
detection effectively for classes and defined resources. As we continue to work
on the code and find regressions this work can be expanded.

For facts and functions I've also taken a basic approach for now.

One little thing I did change, was the strange string that the fact returns
when the default version is undefined. Instead of an error message I've just
returned the string 'unknown' which is more in line with other facts I've seen
in the wild, and to be quite honest 'unknown' is fairly self-explantory. Since
a fact isn't an error reporting message this seemed more appropriate, and looked
nicer in the rspec test.

As far as travis-ci support, I've added the same configuration that @jmmcune
came up with for stdlib which is pretty light and reasonable standard now we
propogated that to 4 or so other modules in the puppetlabs/ namespace. It should
work out of the box.

Signed-off-by: Ken Barber <ken@bob.sh>
2013-02-05 15:15:03 +00:00