Commit graph

214 commits

Author SHA1 Message Date
Ken Barber
e1acc2774f Fix inherits issue with validate_db_connection
Previously the validate_db_connection defined type was trying to use inherits
like a class. This of course would fail.

After analyzing its usage, I've removed the need for the top-level params
inherit by just including the 'postgresql' module which pulls in the client
package and the params class as well. It also avoids resource duplication
for the client package as well.

To ensure we don't get regression on this I've added system tests that test
this defined type in a success and failure state.

Signed-off-by: Ken Barber <ken@bob.sh>
2013-01-11 21:57:38 +00:00
Ken Barber
358ebc178b Merge pull request #58 from Mosibi/master
Turn the exec in validate_db_connection.pp around
2013-01-11 04:21:44 -08:00
Ken Barber
4cd9da77c0 Merge pull request #55 from Spenser309/master
Syntax Error
2013-01-11 01:12:37 -08:00
Chris Price
53224c0ab8 Merge pull request #59 from puppetlabs-operations/wheezy_default_version
Add Debian wheezy support for default version fact
2013-01-08 10:06:49 -08:00
Adrien Thebo
147fa8e59b Add Debian wheezy support for default version fact
Debian Wheezy has a default version of 9.1, but doesn't currently have
an operatingsystemrelease value beyond 'wheezy'. This command searches
for wheezy in the operatingsystemrelease fact and sets the fact value
accordingly.
2013-01-07 19:02:34 -08:00
Richard Arends
fcace1e5c0 changed validate_db_connection.pp 2012-12-28 10:00:15 +01:00
Spenser Gilliland
457f80bfe4 Syntax Fix 2012-12-21 17:26:48 -06:00
Chris Price
8bb71e4bc1 Merge pull request #50 from maestrodev/psql-cwd
This is great--thank you!
2012-12-14 08:30:16 -08:00
Brett Porter
6b53c07da0 set an appropriate parent for the parameter 2012-12-14 23:22:38 +11:00
Brett Porter
6367e359ea add optional cwd to the postgres_psql command
When the psql command runs from a directory it does not have permission to
access, it outputs an error. This error trips up the unless SQL command,
causing the other SQL commands to run even if not needed. Rather than ignore
stderr (which might hide something else), or use an arbitrary directory like
/tmp, this code sets the cwd to the data directory, which will exist and be
owned by the postgres user. If someone uses the postgres_psql type and
customises the psql_user parameter, they should also set an appropriate cwd.
2012-12-14 23:02:18 +11:00
Chris Price
9febf9a6ed Merge pull request #46 from cprice-puppet/feature/master/refactor-default-version-fact
Rework `postgres_default_version` fact
2012-12-11 07:36:42 -08:00
Chris Price
07b4dd2f78 Merge pull request #48 from florinbroasca/master
Fix default version for Ubuntu and Debian
2012-12-10 08:59:20 -08:00
Chris Price
9fd8b48074 Merge pull request #49 from nzakaria/master
Moved remote access for other users to end of IPv4 section
2012-12-10 08:50:00 -08:00
nzakaria
d7e474a695 Update templates/pg_hba.conf.erb
Moved the ip mask for allowing remote access for other users to the end of the IPv4 section
so that it doesn't block access to the DB via local loopback for other forms of authentication (such as LDAP).
2012-12-10 14:42:04 +11:00
Florin Broasca
b02556f96c Fix default version for Ubuntu and Debian 2012-12-09 23:56:27 +02:00
Chris Price
052085bcc0 Merge pull request #47 from cprice-puppet/feature/master/fix-yum-gpg-keys
Fix GPG key for yum.postgresl.org
2012-12-07 11:37:44 -08:00
Chris Price
97af59e701 Fix GPG key for yum.postgresl.org
The GPG key for yum.postgresql.org was in the wrong directory,
and as written, would have only supported postgres 9.2 anyway.

I looked at the yum rpms for a few other versions besides 9.2,
and they appear to be using the same GPG key.  So this commit
assumes that they all are doing so, and it sets things up
accordingly.  Hopefully this will make the yumrepo support
compatible with other versions of postgres besides 9.2, but I
haven't added that to the actual test matrix yet.
2012-12-07 11:34:30 -08:00
Chris Price
208b663ad1 Rework postgres_default_version fact
This commit fixes up the `postgres_default_version` fact so that
it doesn't use apt/yum (slow), and instead just has a hard-coded
list of default postgres versions for various OS versions.  We
will need to add new OS versions to this fact over time, but that
seems preferable to the previous implementation which was causing
slower puppet runs on all nodes (regardless of whether they were
actually using postgres or not).
2012-12-07 10:40:18 -08:00
Chris Price
afd8e90dd5 Fix to 'require' for database_grant 2012-12-06 14:35:42 -08:00
Chris Price
9d12358917 Merge pull request #43 from cprice-puppet/feature/master/support-non-default-versions
Feature/master/support non default versions
2012-12-06 14:08:01 -08:00
Chris Price
228e5c5337 Cleanup and move control of version into params
Thanks to some tricks I learned from Nan Liu and Dan Bode, I was
able to figure out a way to move all of the new version-related stuff
back into the params class, and clean up some of the if/_real stuff.

Basic tests for centos6 + pg 9.2 are passing.
2012-12-04 14:12:41 -08:00
Chris Price
18167c7a3e Merge platform.pp back into params.pp
Nan showed me a trick that will let us keep all of that param stuff
inside of params.pp, make it a parameterized class, and still support
the ability for users to specify a custom (non-system-default) pg
version.  This commit takes the first step towards that pattern by
consolidating platform.pp and params.pp.  (Everything old is new again!)
2012-12-04 14:12:34 -08:00
Chris Price
fa24f24397 Re-add support for managing yumrepo
This commit creates a new class called `package_source_info`,
which has some initial framework for managing the postgresql.org
yumrepo.  It also serves as a container for the 'version'
variable that is needed by the 'platform' class in order to
use other versions of postgres besides the system default.
2012-12-02 23:06:36 -08:00
Chris Price
663c779309 A few minor fixes to get tests passing again 2012-12-02 22:05:57 -08:00
Chris Price
de45945aff Merge ::paths and ::packages into one class, called ::platform. 2012-12-02 20:59:18 -08:00
Chris Price
90ed7aaf6d Working on getting ubuntu specs passing again
The service provider / status stuff got a little broken during
the refactors.  This should mostly fix it but there is still
one spec failing, and I will probably also refactor the
paths.pp and packages.pp into a single file together eventually.
2012-12-02 20:56:36 -08:00
Etienne Pelletier
d1025e90ef Removed references to postgresql::paths in class params. 2012-12-02 20:56:36 -08:00
Etienne Pelletier
33add5e10a Removed postgresql::version class and moved version info to init.pp. 2012-12-02 20:56:29 -08:00
Etienne Pelletier
db1a34e7ea Removed references to $postgresql::paths in class params. 2012-12-02 20:54:39 -08:00
Etienne Pelletier
ca701b303c Removed repo class. 2012-12-02 20:54:39 -08:00
Chris Price
2a108abe8b Fix paths 2012-12-02 20:54:39 -08:00
Etienne Pelletier
1fe9559bbe Refactored multi-version support. 2012-12-02 20:54:33 -08:00
Etienne Pelletier
1661ff1696 Stupid Librarian 2012-12-02 20:49:47 -08:00
Etienne Pelletier
28319062ba Stdlib issues again. 2012-12-02 20:49:47 -08:00
Etienne Pelletier
50f9d3a427 More issues with stdlib dependencies. 2012-12-02 20:49:47 -08:00
Etienne Pelletier
892ca0d8d4 Reverted back to 3.x version of stdlib 2012-12-02 20:49:47 -08:00
Etienne Pelletier
5343c50efa Trying to overcome issues with stdlib version 2012-12-02 20:49:47 -08:00
Etienne Pelletier
a5d3de2dc4 Pulled repository stuff out of params.
Lint cleanup.
2012-12-02 20:49:47 -08:00
Chris Price
b9a51be36e Fix paths 2012-12-02 20:49:47 -08:00
Etienne Pelletier
8e96959ca8 Added easier support for Postgresql 9.0 (on RedHat platforms) 2012-12-02 20:49:47 -08:00
Chris Price
1b82be0f89 A little more framework for CentOS pg9 testing 2012-12-02 20:47:04 -08:00
Chris Price
5c9658a994 Merge pull request #42 from cprice-puppet/maint/master/support-more-distros-in-tests
Maint/master/support more distros in tests
2012-12-02 16:52:23 -08:00
Chris Price
cf32763937 A bit more refactoring of test context code 2012-12-02 16:41:35 -08:00
Chris Price
df92c96791 Refactor tests and add CentOS6 image
This commit does a fairly major refactor of how the spec tests
are laid out.  The main goal was to make it easier to run
a subset of the tests--e.g., the ability to only run tests
on a single OS via a simple rspec command.

The test logic is now defined in some shared examples in the
`support` directory.  There are now spec folders for each
distro, which contain some stubs to include the shared examples
as well as a Vagrantfile for the particular distro.

Also, the system-default postgres package tests now run
successfully against the CentOS6 VM that is defined by the
Vagrantfile.
2012-12-02 15:28:25 -08:00
Chris Price
bdecbe6503 Framework for testing on Cent6 / PG9
This commit does the following:

* Adds a CentOS6 vm to the Vagrantfile
* Reorganizes the spec test file a bit so that it will be easy
  to test various things on different VMs.

This is in preparation for adding some PG9 tests to run on
Cent6.
2012-11-30 17:27:23 -08:00
Chris Price
5585b6bb50 Merge pull request #25 from cprice-puppet/feature/master/port-psql-to-ruby
Initial working implementation of ruby psql type/provider
2012-11-30 16:31:46 -08:00
Chris Price
76fcf269d8 Merge branch 'master' into cprice-puppet-feature/master/port-psql-to-ruby
Conflicts:
	manifests/database.pp
	manifests/database_grant.pp
	manifests/psql.pp
	manifests/role.pp
2012-11-30 15:49:07 -08:00
Chris Price
338ae56b8c Merge pull request #40 from Spenser309/master
Updated.  This will fix initdb failures.
2012-11-27 12:01:46 -08:00
Spenser Gilliland
f7a939b290 Fix Issue #38: Require postgresql-server package to run initdb exec 2012-11-27 13:58:30 -06:00
Chris Price
cb9f282a5f Merge pull request #35 from antaflos/reload-postgres
Set sensible path in exec to reload postgres
2012-11-15 16:17:57 -08:00