Commit graph

337 commits

Author SHA1 Message Date
Hunter Haugen
9e9aa9da85 Merge pull request #564 from antaflos/idempotency_for_grant_all_tables
Make granting on ALL TABLES IN SCHEMA idempotent
2015-03-12 10:28:34 -07:00
Morgan Haskel
d348cdb4b6 Merge pull request #579 from sathieu/template_encoding
(MODULES-1834) Be less strict when changing template1 encoding
2015-03-12 10:06:53 -07:00
Mathieu Parent
f3a0db44ef (MODULES-1834) Be less strict when changing template1 encoding
We currently use: UTF8 != UTF-8
We should instead use: pg_char_to_encoding(UTF8) == pg_char_to_encoding(UTF-8)
2015-03-10 10:03:44 +01:00
Morgan Haskel
154517aa32 There was a default case in the selector 2015-03-06 15:53:05 -08:00
Morgan Haskel
dcfe75eb95 Rework defaults for $object_name in postgresql::server::grant
You don't have access to parameters within the parameter list.
2015-03-06 15:49:07 -08:00
Sebastian Reitenbach
ef1681f5e5 Changes to support OpenBSD.
Added $service_reload parameter to params.pp, in order to allow
a reload of the postgresql server on OpenBSD, which apparently doesn't
have a service binary.
2015-03-06 14:11:33 -08:00
Andreas Ntaflos
dbbb7aa2b3 Make granting on ALL TABLES IN SCHEMA idempotent
Define a proper SELECT statement to feed into Postgresql_psql's
`unless` parameter that checks if there are any tables in the specified
schema for which the specified role *does not* have the specified
privilege. Only then allow the GRANT statement to be executed. For
details see comments.

Note that this, too, suffers from the problem that there is no feasible
way to check if a role has ALL PRIVILEGES on a table in plain SQL. By
terrible convention the INSERT privilege represents ALL PRIVILEGES here.
2015-03-05 17:18:42 +01:00
Andreas Ntaflos
aee6dba6f8 Use correct TCP port when checking password
The PostgreSQL server's port is specified in `postgresql::server::port`, so use it in the `unless` clause of `Exec['set_postgres_postgrespw']`. Failing to do so results in repeated invocations of the exec resource during Puppet runs when the server's port is not set to the default of 5432.
2015-02-27 04:48:15 +01:00
Colleen Murphy
b77c213351 Merge pull request #565 from gerhardsam/create_role_before_db
create role before database
2015-02-26 13:20:04 -08:00
Mickaël Canévet
9303828255 Fix for future parser 2015-02-25 13:50:32 +01:00
Sebastian Gerhards
a246e586be create role before database
Creating the role before creating the database is mandatory because otherwise
granting the access right to the database fails.
2015-02-23 11:57:05 +01:00
Mickaël Canévet
e1034d9bee Fix template1 encoding on debian 2015-02-19 08:37:31 +01:00
Hunter Haugen
f889a4612d Fix comment detection
On psql 8.1, `pg_catalog.shobj_description` does not exist. Also, if the
database to comment is not the current db then this warning will be
raised and the comment will not be applied: `WARNING:  database comments
may only be applied to the current database`

This fix uses the pg_* databases to find the comment based on the
database oid rather than the shared object description function.
2015-02-05 14:39:58 -08:00
Colleen Murphy
6d2b66cc3d Merge pull request #558 from hunner/fix_dbcomment
Fix comment detection
2015-02-04 22:48:28 -08:00
Hunter Haugen
bd80c54664 Fix comment detection
On psql 8.1, `pg_catalog.shobj_description` does not exist. Also, if the
database to comment is not the current db then this warning will be
raised and the comment will not be applied: `WARNING:  database comments
may only be applied to the current database`

This fix uses the pg_* databases to find the comment based on the
database oid rather than the shared object description function.
2015-02-04 13:41:11 -08:00
Hunter Haugen
50ae9efbad Require server package before user permissions
The postgresql user is created by the server package, but this file
resource may be evaluated before the package is installed resulting in
permission failures.
2015-02-04 13:39:33 -08:00
Colleen Murphy
d42b821969 Merge pull request #521 from raphink/dev/server_extension
Add postgresql::server::extension definition
2015-02-04 14:26:53 +01:00
juniorsysadmin
435d63297a (MODULES-1153) Add database comment parameter 2015-02-04 22:45:28 +11:00
Colleen Murphy
46567450fa Merge pull request #529 from phervieux/utopic
add utopic support
2015-02-04 12:05:14 +01:00
Colleen Murphy
f2e075d92c Merge pull request #554 from multiplay/freebsdfix
FreeBSD PostgreSQL wouldn't start first time
2015-02-04 11:59:54 +01:00
Colleen Murphy
7b5a992aa1 Merge pull request #553 from PierreR/patch-1
Replace require by include
2015-01-27 12:14:47 -08:00
Lee Packham
937f8825f5 FreeBSD PostgreSQL wouldn't start first time
It would be enabled, but it wouldn't work properly. This fixes that
issue the same way Puppet does itself; use the onestart/onestop and most
importantly in this case, the onestatus command.

By using this approach it means the Database server will actually start
whereas it would not before. It would enable, but not actually start.
onestatus means the service type gets the right response and behaves
properly.
2015-01-24 00:07:29 +00:00
juniorsysadmin
32ebbb5e34 Fix lint warnings 2015-01-21 10:46:29 +11:00
Pi3r
9a29aea976 Replace require by include
Avoid using the `require` function (which is IMHO a bad practice) by being more explicit in the `require` attribute value.
2015-01-13 09:24:29 +01:00
Tom De Vylder
0625b91d71 Fix invalid byte sequence in US-ASCII error 2015-01-09 13:33:30 +01:00
Hunter Haugen
094f5d8d0b Merge pull request #535 from pishro-oss/master
Fixing autodetected version for Debian Jessie, which should use postgresql 9.4
2015-01-08 10:10:25 -08:00
Morgan Haskel
7c520bd220 Merge pull request #538 from mattbostock/groupeseb-master
Allow per-schema grants and support for 'ALL TABLES IN SCHEMA'
2014-12-22 10:10:48 -08:00
Raphaël Pinson
807fefe5fa Add postgresql::server::extension definition 2014-12-08 16:27:33 +01:00
juniorsysadmin
789543fc45 Add service_manage parameter
Loosely addresses MODULES-1522
2014-12-05 10:10:17 +11:00
Benoît Marcelin
d655024066 Add schema creator 2014-12-02 20:54:22 +00:00
Benoît Marcelin
aef405c39c Add support for GRANT SCHEMA and ALL TABLES IN SCHEMA 2014-12-01 16:07:38 +00:00
Benoît Marcelin
9278954cfe Make module compatible with puppetDB 2014-12-01 16:07:38 +00:00
Armin ranjbar
9bb1c5e491 Fixing autodetected version for Debian Jessie, which uses postgresql 9.4 2014-11-21 22:26:18 +03:30
Travis Fields
9aebc4fbfe MODULES-1485 Reverted to default behavior for Debian systems as pg_config should not be overridden 2014-11-21 11:58:23 -05:00
Patrick Hervieux
36bbd6ed2a add utopic support 2014-11-14 16:05:38 +01:00
Morgan Haskel
4f4cfb02d4 Merge pull request #517 from cmurphy/fix_datadir
Fix data directory handling
2014-10-31 16:36:07 -07:00
Colleen Murphy
6ba3179916 Fix data directory handling
The change introduced in b781849882 added
a complex operation that was not handled correctly for all operating
systems. This fix includes the following corrections:

- Change the systemd config and reload systemd for datadir changes in
  RHEL 7, and move configuration for this into
  postgresql::server::config since it is managing both the PGDATA and
  PGPORT variables
- Make sure Debian systems stop the service before changing the datadir
- Recreate cert links after running initdb in Debian and early ubuntu
- Change the port in the port spec to avoid selinux issues
- Turn off selinux in pgdata spec to avoid selinux issues
- Correct syntax for describing presence of a directory in pgdata spec
- Move the pgdata spec to the end of the tests so that puppet doesn't
  have to manager purging and recreating the original datadir
- Update README to describe all caveats of using this parameter
2014-10-31 16:03:15 -07:00
Morgan Haskel
e688274cb0 Merge pull request #515 from lofic/master
Link to the sysconfig file for the init script of the PGDG postgresql se...
2014-10-31 15:12:59 -07:00
Colleen Murphy
fb719070a7 Merge pull request #514 from mixacha/pg_data_support
Adds support for PGDATA changing
2014-10-30 14:46:11 -07:00
David Caro
53048211d0 Added fc21 default version 2014-10-27 19:23:29 +01:00
Milan Karalic
b781849882 Adds support for PGDATA changing in config_entry.pp
Ensure that data_directory is set in the config. per GitHub user tbd - PR#510 / PR#494 that was filed against wrong module branch"
Adds acceptance test for non default PGDATA, based on alternative_port_spec.rb
Fixes unit test for data directory
2014-10-23 23:37:03 +02:00
lofic
bcac7782a7 Link to the sysconfig file for the init script of the PGDG postgresql server package 2014-10-23 10:48:53 +02:00
Morgan Haskel
b7ff175594 Merge pull request #501 from cfeskens/allow-rhel7-repo
postgresql.org now has a RHEL7 repo available
2014-10-02 12:23:34 -05:00
Hunter Haugen
d553583ff8 Merge pull request #484 from tbartelmess/master
ticket/MODULES-1298
2014-10-02 10:08:28 -07:00
Stephen Price
289de739c3 fix future parser error 2014-09-16 11:19:43 -07:00
Casey Feskens
ba67952288 postgresql.org now has a RHEL7 repo available 2014-09-11 09:23:56 -07:00
Ashley Penney
4015dee539 Remove trailing whitespace. 2014-09-03 16:35:14 -04:00
Ashley Penney
29a597ab05 Improve port changing support.
This makes Debian 6 work, and hopefully Ubuntu 10.04 too.
2014-09-03 16:17:19 -04:00
Ken Barber
5ac19f97f1 Fix lsbmajdistreleasee fact for Ubuntu
Since facter 2.2.0 'fixed' the lsbmajdistrelease fact for Ubuntu, we now have to regexp
for the value. The new value would be '10.04' whereas the old is '10'.

Signed-off-by: Ken Barber <ken@bob.sh>
2014-09-03 11:25:56 -04:00
Thomas Bartelmess
424f3eda3f default_postgis_version for FreeBSD
Signed-off-by: Thomas Bartelmess <tbartelmess@marketcircle.com>
2014-09-01 17:00:39 -04:00