Commit graph

68 commits

Author SHA1 Message Date
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
Andreas Ntaflos
d44de361b6 Set sensible path in exec to reload postgres
In the exec resource to reload postgres add path parameter and set it to
"/usr/bin:/usr/sbin:/bin:/sbin", so that the service command can be
called correctly on different platforms.
2012-11-15 16:39:56 +01:00
Chris Price
879c41e44f Merge pull request #33 from antaflos/reload-postgres
Reload postgresql after changes to pg_hba.conf
2012-11-12 11:32:12 -08:00
Andreas Ntaflos
19a512b06d Add new exec 'reload_postgresql' and have the pg_hba.conf file resource
notify that exec after changes to pg_hba.conf. This avoids restarting
the whole postgresql cluster for configuration changes in pg_hba.conf
which only need a reload.
2012-11-09 23:46:16 +01:00
Chris Price
7612cb9539 Merge pull request #32 from antaflos/quote-dbname
Properly quote database name when using postgresql::psql
2012-11-09 08:13:31 -08:00
Chris Price
b8ccbeb3c5 Merge pull request #29 from etiennep/master
Issue #28
2012-11-09 08:13:01 -08:00
Andreas Ntaflos
c4147a4105 Properly quote database name when using postgresql::psql for GRANT or REVOKE. 2012-11-09 04:20:36 +01:00
Etienne Pelletier
10426aaf58 Bumped stdlib dependency to 3.x 2012-11-08 16:13:29 -06:00
Etienne Pelletier
9adcd182f8 Added check before adding postgresql::user
This is to make sure there are no duplicate definitions when creating multiple
databases owned by the same user.
2012-11-08 12:50:08 -06:00
Etienne Pelletier
ef14e8d26c Issue #28 Changed stdlib version to >=2.0.0 to allow using newer version of stdlib. 2012-11-08 10:12:51 -06:00
Chris Price
2a922f104a Initial working implementation of ruby psql type/provider
This commit provides a working implementation of a ruby
type/provider (`postgresql_psql` for handling the PSQL
commands.  This is a little more flexible than doing it
via Exec resources, which is what the `postgresql::psql`
type was doing.

The old type is still present but now includes a
deprecation notification, and all of the other types
that were using the `::psql` type have been ported over
to use the `postgresql_psql` type instead.
2012-11-04 21:47:49 -08:00
Chris Price
a6f2e257c9 Merge pull request #24 from blkperl/fix_tests
Puppet lint fixes and test typo
2012-11-03 13:37:43 -07:00
William Van Hevelingen
bdf6c0b84c Puppet lint fixes
- left longer than 80 char warnings
 - left inherits params class warnings
2012-11-03 02:37:20 +00:00
William Van Hevelingen
65f8d27f11 Fix typo in server smoke test 2012-11-03 01:34:06 +00:00
Chris Price
686f1ca0e3 Merge pull request #23 from albertkoch/master
Support special characters in database role name
2012-11-01 09:39:29 -07:00
Albert Koch
9a0716f127 Support special characters in database role name
This will allow characters such as '-' in database role
names. Additionally, escaping of '"' characters now applies to all '"'
characters, not just the first in a sql command.
2012-11-01 09:45:20 -04:00
Chris Price
c3c4d32267 Merge pull request #19 from jarib/fix-path-for-cat
Fix path for `/bin/cat`
2012-10-29 10:47:03 -07:00
Chris Price
7b71eb36f9 Merge pull request #22 from cprice-puppet/patch-1
Update README.md
2012-10-29 10:46:43 -07:00
Chris Price
10d916ef64 Merge pull request #20 from dharwood/dharwood/pg_hba_acls
Defining ACLs in pg_hba.conf
2012-10-29 10:46:30 -07:00
Chris Price
8529c1fa46 Add deprecation warning for postgres::psql
This commit adds a deprecation warning for the
Exec-based postgres::psql type, and a test
to verify that the deprecation warning is
being generated.
2012-10-27 18:41:47 -07:00
Chris Price
32b65b874a Fix tests so that they can be run multiple times
One of the spec tests was creating a table to test
some user privileges.  However, it wasn't dropping
the table afterwards, meaning that the same test
would fail on the next run because that table already
existed.  This commit adds a command to drop the
table so that the tests can be run several times
in sequence.
2012-10-27 18:04:15 -07:00
Chris Price
8c082a0f65 Update README.md
Correct references to 'user' and 'grant' types, which were renamed to 'database_*'.
2012-10-27 17:04:52 -07:00
Ryan Coleman
183d401a3f Merge pull request #21 from rcoleman/puppetlabs_ownership
Adjust ownership to Puppet Labs
2012-10-24 10:29:45 -07:00
Ryan Coleman
2c82464f24 Adjust ownership to Puppet Labs
Prior to this commit, Inkling Systems was responsible for improving
and maintaining this module. The maintainer has moved on and Inkling
wished for Puppet Labs to continue with this modules maintenance.

This commit adjusts the README and Modulefile for this change in
ownership.
2012-10-24 10:20:20 -07:00
dharwood
555f3e9838 typos in readme and test/server.pp 2012-10-22 12:41:05 -07:00
dharwood
b8389d19ad ACLs functioning, added examples in README and test, comments in config manifests 2012-10-22 12:34:24 -07:00
stormcrow
399709a483 first commit of acls 2012-10-21 23:46:54 -07:00
Jari Bakken
1fe7a87923 Fix path for /bin/cat 2012-10-21 18:52:02 +02:00
Kenn Knowles
847a5919dd Merge pull request #16 from bjoernalbers/server_example
Add sample usage for postgresql::server class.
2012-10-18 04:21:04 -07:00
Kenn Knowles
22e71423d4 Merge pull request #17 from puppetlabs-operations/master
Add postgresql::devel for development dependencies
2012-10-18 04:19:37 -07:00
Kenn Knowles
389833f87d Merge pull request #11 from cprice-puppet/bug/master/better-title-for-persist-firewall-resource
Give the persist-firewall Exec a more explicit name
2012-10-18 04:19:15 -07:00
Adrien Thebo
5e713569ac Add postgresql::devel for development dependencies 2012-10-16 21:22:30 -07:00
rbscott
d2131e3174 Merge pull request #13 from haf/warnings-etc
Warnings etc
2012-10-16 21:08:46 -07:00
Björn Albers
f40b79382a Add sample usage for postgresql::server class.
I had some issues trying to connect to the server, managed with
defaults:

  vagrant@precise32:~$ psql
  psql: FATAL:  role "vagrant" does not exist
  vagrant@precise32:~$ psql -U postgres
  psql: FATAL:  Peer authentication failed for user "postgres"
  vagrant@precise32:~$ psql -U postgres -h 127.0.0.1
  psql: FATAL:  pg_hba.conf rejects connection for host "127.0.0.1", user
  "postgres", database "postgres", SSL on
  FATAL:  pg_hba.conf rejects connection for host "127.0.0.1", user
  "postgres", database "postgres", SSL off
  vagrant@precise32:~$ psql -U postgres -h /var/run/postgresql
  psql: FATAL:  Peer authentication failed for user "postgres"

After some trial and error I found out that the reasons for this was
restrictive permissions on the unix socket (which isn't bad at all):

  vagrant@precise32:~$ ls -l /var/run/postgresql/
  total 4
  -rw------- 1 postgres postgres 5 Oct 16 20:16 9.1-main.pid

So I though I send some usage examples to help noops like myself to a
quicker start with your module :-)
2012-10-16 23:39:48 +02:00
Henrik
1026da2914 mis-spelt param names 2012-10-04 12:16:40 +02:00
Henrik
9af4019354 $quoted_unless had extra $ 2012-10-04 12:14:46 +02:00
Henrik
69e38d5ceb missing 'default' selector case 2012-10-04 12:13:00 +02:00
Henrik
e0c1836b2e end of line comma not valid in versions < 2.8.7 2012-10-04 12:12:12 +02:00
Kenn Knowles
4e74e33b5c Merge pull request #12 from haus/update_status_param_for_deb_ubuntu
Update status for postgres service on Debian
2012-10-01 23:25:07 -07:00
Matthaus Owens
82c5863431 Update status for postgres service on Debian
The postgresql init script on debian/ubuntu returns 0 no matter whether postgresql is started or stopped, so puppet has no way of knowing whether to start postgresql when the service is set to 'ensure => running'. This commit adds a param to the params class called $service_status which is set to the status piped to an egrep on debian/ubuntu, which reliably returns 0 if there are clusters running and 1 if there are none. The output before and after this patch can be seen below. If the init script is fixed at some point, the logic would need to be revisited.

Before patch postgresql remains stopped after puppet run.

$ # service postgresql stop
$ #   * Stopping PostgreSQL 9.1 database server
$ # puppet apply -e "class {'postgresql::server':}"
$ #   notice: Finished catalog run in 0.15 seconds
$ # service postgresql status
$ #   Running clusters:

After patch postgresql is started after puppet run.

$ # service postgresql stop
$ #   * Stopping PostgreSQL 9.1 database server
$ # puppet apply -e "class {'postgresql::server':}"
$ #   notice: /Stage[main]/Postgresql::Server/Service[postgresqld]/ensure: ensure changed 'stopped' to 'running'
$ #   notice: Finished catalog run in 2.26 seconds
$ # service postgresql status
$ #   Running clusters: 9.1/main
2012-09-28 15:53:33 -07:00
Chris Price
f221c8a6a4 Give the persist-firewall Exec a more explicit name
The title I'd used for the persist-firewall resource
was too generic, and fairly likely to collide with
resources in other modules.  This commit simply
renames it to be a bit more explicit about belonging
to this module, to reduce the likelihood of a title
collision.
2012-09-21 09:02:59 -07:00
Kenneth Knowles
12eef2eaa8 Advance version to 0.3.0 2012-09-17 10:42:05 -07:00
Kenn Knowles
7181817e6a Merge pull request #9 from cprice-puppet/feature/master/connection-validator
Feature/master/connection validator
2012-09-16 18:34:58 -07:00
Kenn Knowles
fc48ad04a1 Merge pull request #8 from haus/patch-1
Remove $service_provider setting for ubuntu
2012-09-16 18:34:32 -07:00
Chris Price
fcc0d70e1b Add changelog 2012-09-14 13:26:28 -07:00
Chris Price
fd1b15b950 Add a type for validating a postgres connection
This commit adds a new resource type that can be used to validate
that a successful postgres connection can be established from a
puppet node to a (potentially remote) postgres database instance.
2012-09-14 13:26:28 -07:00
Matthaus Litteken
61f077bb20 Remove $service_provider setting for ubuntu
Ubuntu's precise ships with init scripts, not with upstart service definitions. Declaring the provider to be upstart will cause service management on postgres to fail. Leaving it undefined will allow puppet to select the correct (init) provider.
2012-09-12 22:11:10 -07:00