Commit graph

23 commits

Author SHA1 Message Date
Ashley Penney
a29d038287 Merge pull request #401 from cfeskens/add-perl-support
Add class postgresql::lib::perl for perl support
2014-04-17 13:27:00 -04:00
Mickaël Canévet
0b7bb333d8 Fix strict_variables issues 2014-04-08 17:37:29 +02:00
Casey Feskens
9e60640bd9 Add class postgresql::lib::perl for perl support 2014-04-04 06:13:30 -07:00
Jeremy Kitchen
c4bca511e9 add support for postgis
rhel support added by @mcanevet, but the branch has been squashed.
thanks!
2014-03-31 21:40:01 +00:00
Hunter Haugen
87cc257545 Missing lsbdistid stub for apt module 2014-02-25 17:18:35 -08:00
Ashley Penney
488e988a0c Merge pull request #322 from bcomnes/amazon
Added newline at end of file
2014-01-21 15:03:21 -08:00
Ashley Penney
301715b8a9 Merge pull request #256 from mnencia/patch-3
Add support to custom xlogdir parameter
2014-01-21 14:24:10 -08:00
Joshua Hoblitt
2f74feba2c update rspec-puppet tests to use contain_class() instead of include_class() 2014-01-07 15:16:09 -07:00
Marco Nenciarini
2b81d5cb63 Add support to custom xlogdir parameter
Having a custom xlogdir location is desiderable for performances in many production environments
2013-12-14 23:55:24 +01:00
Bret Comnes
b0f082c226 Added newline at end of file 2013-11-30 18:02:16 -08:00
Ken Barber
5df36cf1f7 (GH-198) Fix race condition on postgresql startup
This patch is a fix for the race condition that keeps occuring during
postgresql setup. Its very rare on its own, but when you are using this
module in a CI environment it happens quite frequently.

Basically what happens is that sometimes the service will announce the
database has started, but really it is still working in the background.
Sometimes the unix socket may not be listening, and sometimes the
system is still loading and you get a weird client error.

The fix itself is a modification to postgresql::validate_db_connection
so that it is able to connect on the local unix socket, plus retry
until the database is available.

This new and improved validate_db_connection can then be put into the
build pipeline (in the service class in particular) to ensure the
database is started before continuing on with the remaining steps.

This in effect blocks the puppet module from continuing until the
postgresql database is fully started and able to receive connections
which is perfect.

Tests and documentation provided.

Signed-off-by: Ken Barber <ken@bob.sh>
2013-10-24 00:33:45 +01:00
Bret Comnes
2718f14017 Special case for $datadir on Amazon
Closes #252
2013-10-02 12:48:44 -07:00
Ken Barber
891b1d71a2 Rename contrib to server::contrib
Signed-off-by: Ken Barber <ken@bob.sh>
2013-09-20 14:35:24 +01:00
Ken Barber
ce94eb348a Modify tests for postgresql::server to test for purged state
Since we are now forcing ensure => purged in places, some unit tests need to
be reworked to accept that.

Signed-off-by: Ken Barber <ken@bob.sh>
2013-09-14 06:39:17 +01:00
Ken Barber
27c5cc0304 Provide package removal fixes for Debian tests
This patch provides fixes to help tests pass on Debian. The failures were in
relation to the lack of proper removal of the server and contrib parts. Setting
the ensure => purged parameter for removal seems to have solved a lot of this.

Also, the ordering for contrib being (un)installed needed some work.

I've also made sure we use 'purged' a lot more in tests to make sure we clean
up after ourselves properly.

Signed-off-by: Ken Barber <ken@bob.sh>
2013-09-14 06:39:17 +01:00
Ken Barber
59c1cbfbf8 Major rewrite to solve order dependencies and unclear public API
This is a very very large change to the module. It started out as a fix to add
postgresl::server::config_entry, and quickly became a rewrite to fix a lot of
ordering issues inherent in the API.

Since this changes the Public API it is considered a backwards compatible
change.

See the upgrading guide in README.md for more details as to what has been
modified in this patch.

Signed-off-by: Ken Barber <ken@bob.sh>
2013-09-14 06:39:15 +01: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
Kamil Szymanski
82ce5d0480 Add documentation, rspec test and support for global overriding contrib package name 2013-03-02 10:49:57 +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
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
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