Commit graph

160 commits

Author SHA1 Message Date
7272d038f7 Changing default value of owner, fixing blocking bug 2016-08-14 18:05:48 +02:00
Nate Potter
82c6716d48 (MODULES-3247) Enable schema and database ownership change
Currently postgresql::server::schema, postgresql::server::db and
postgresql::server::database allow creating new schemas and
databases if they don't already exist and assigning owners to
them. This patch enables changing the owner of a schema or database
that already exists if the change_ownership variable is set to true.
2016-07-09 15:55:51 -07:00
tphoney
d72a58cde1 {maint} modulesync 0794b2c 2016-06-30 11:44:56 +01:00
micah-uber
63ee3a55f1 Update config_entry.pp add ability to set log_min_duration_statement 2016-06-07 17:30:50 -07:00
Dominic Cleal
9c2a99b9e5
(MODULES-3442) Use empty array for missing resource relationships
Empty require/before relationships in the server extension package
resource are changed from undef to empty arrays to work around PUP-6385
in Puppet 4.5.x. Previously undef was passed literally through
create_resources() causing Puppet to fail to find the resource named
`undef`.
2016-06-03 23:24:05 +01:00
Ondrej Prazak
b2cb2dfff0 Adds timestamps into logs by default 2016-04-05 10:59:22 +02:00
Hunter Haugen
35bfae5230 Remove unused variable and update template comment 2016-03-04 16:15:57 -08:00
icetrain
abd6c6fe07 Add missing onlyif_function to sequence grant code 2016-02-15 13:21:42 +01:00
Bryan Jen
6f5002aa0e Merge pull request #719 from matonb/psql_port
Fix password change failing
2016-02-03 11:40:00 -07:00
James Sweeny
5354d0f1ea (MODULES-3024) Quote database objects when creating databases
Prior to this commit, when creating databases with a name or owner that has
characters which must be quoted (e.g., "pe-postgres"), the postgresql::server::database define
fails due to a SQL syntax error.
2016-02-01 17:58:55 -05:00
Brett Maton
d71e3f754d Fix password change failing
postgres db user password change failing when postgres is listening on non standard port number.
2016-01-30 19:01:02 +00:00
Fabrizio Regini
95aa691c62 fix quote around locale options 2015-11-29 13:18:46 +01:00
Stijn Tintel
2f46f6fd25 Use double qoutes around database name.
When using a database name that contains dashes or underscores, the
CREATE DATABASE statement fails with a syntax error. Use double quotes
around the database name to solve this.
2015-10-28 18:17:52 +02:00
David Schmitt
c7c839347f Merge pull request #700 from BobVanB/master
syntax error near UTF8
2015-10-08 12:28:42 +01:00
Stefan Warten
e8c661e207 Added parameter description in README, before-relation if restart_on_change is false, and unit tests for both conditions of the parameter 2015-10-07 16:24:41 +02:00
Bob van Bokkem
fad4c164ab syntax error near UTF8 2015-09-30 14:25:45 +02:00
Stefan Warten
626433a125 Added parameter to disable automatic service restarts on config changes 2015-09-29 10:41:16 +02:00
Stefan Warten
ea9203dd1a Added parameter to disable automatic service restarts on config changes 2015-09-29 10:11:28 +02:00
François Conil
c1f4530634 Fixes MODULES_2059 - adds extension argument
This adds the ability to define the extension name separately from the
"title" of the resource, which allows you to add the extension to more
than one database.

As per the original ticket, extensions in postgresql can be defined on
a per database basis. By using the same name for both the extension and
the instance of postgresql::server::extension, you're getting duplicates
errors if you try to assign an extension to more than one database
2015-09-09 14:26:41 +10:00
David Schmitt
e42d787141 Merge pull request #677 from cavaliercoder/master
(MODULES-2211) Fixed systemd-override for RedHat systems with unmanaged Yum repos
2015-09-01 08:06:43 +01:00
Tom Hey
6a29636155 (MODULES-661) Remote DB support
Adds connection-settings (for remote DB support) when creating DB resources.

Connection-settings allows a hash of options that can be used
when connecting the a remote DB (such as PGHOST, PGPORT, PGPASSWORD
PGSSLKEY) and a special option DBVERSION indicating the version
of the remote database.

Including
- Puppet updates
- Documentation updates
- RSpec unit test updates
- RSpec acceptance test updates
- Some test coverage for connection-settings
- Working acceptance test...
    Basic vagrant setup:
    * Two boxes, server and client
    * Runs puppet code to on server to setup a postgres server that allows all connections and md5 connections, creates db puppet to look at
    * Runs puppet code on client to make a server that a psql command can be run against puppet db on other server
    * Does some fancy stuff to get the fact of the IP from the first server to connect to
- Backwards compatible, with deprecation warnings around old parameters
2015-08-27 11:03:18 +01:00
Nick Walker
25c1bae73a Decouple pg_hba_rule from postgresql::server
This change allows the pg_hba_rule defined type to be used
even if you have not included postgresql::server.

By default it will continue with the same behavior as before,
however, you can now specify some extra parameters that were
previously coming directly from postgresql::server
2015-08-11 11:47:27 -07:00
Ryan Armstrong
f929cadd9c (MODULES-2211) Fixed systemd-override for RedHat systems with unmanaged Yum repos
This change lets the params class compute the name of the correct systemd unit file
via $service_name.
2015-07-29 16:53:00 +08:00
David Schmitt
d5efb1fea3 Merge pull request #665 from bmjen/squash-620
Support granting permission on sequences.
2015-07-02 19:18:48 +01:00
qha
c9ffadd31b Support granting permission on sequences.
add spec test for sequence grant and document postgresql::server::grant.
2015-07-02 10:33:15 -07:00
Morgan Haskel
d6435e47c6 Merge pull request #625 from covermymeds/update_pg_hba_rule
(#2056) Added 9.4, corrected past versions based on docs
2015-07-02 10:23:35 -07:00
Ken Barber
1d974be09f (MODULES-2181) Fix variable scope for systemd-override
$manage_package_repo wasn't in scope for the template systemd-override.erb
This was causing all RHEL7 systems with manage_package_repo on to fail on
startup using systemctl, as the proper path to the original service file
is set incorrectly.

This patch adds the manage_package_repo to the top of the ::config class,
and adds some basic tests in config_spec.rb to ensure we don't regress on
this.

Signed-off-by: Ken Barber <ken@bob.sh>
2015-07-01 14:13:29 -07:00
Travis Fields
c4c0402bd4 Merge pull request #527 from kimor79/psql-onlyif 2015-06-25 14:04:10 -07:00
Kimo Rosenbaum
39f15c313c Add onlyif parameter to postgresql_psql to only run command if onlyif returns true
Add option to only attempt table grant if table already exists

Make this slightly more generic
2015-06-25 13:54:02 -07:00
CJ Estel
51fc426be8 Added 9.4, corrected past versions based on docs
adjusted spec to have correct values with change
2015-06-25 16:00:42 -04:00
Hunter Haugen
cb57b323d6 Merge pull request #633 from b0e/master
disabling pg_hba_conf_defaults should not disable ipv4acls and ipv6ac…
2015-06-25 10:43:08 -07:00
Mickaël Canévet
6dbbb6ae9a Copy snakeoil certificate and key instead of symlinking
Since postgresql-9.1_9.1.16-0+deb7u1 on wheezy, postgresql can't read
snakeoil certificate as symlink anymore, so server does not restart.
This patch copies cert and key instead of symlinking so that it works
again.
2015-06-19 14:37:25 +02:00
Chris Denneen
9dc891d06d Fixed systemd override for manage_repo package versions 2015-06-12 10:29:50 -04:00
Hunter Haugen
b5b9c78d76 Merge pull request #623 from dirkweinhardt/MODULES-2049
(#2049) Make title of psql resource for schema creation unique
2015-05-29 10:12:47 -07:00
deVIAntCode
f9c0d91680 Add classes to install PL/Python and the postgresql-docs
See the README for usage and provided parameters.
2015-05-29 10:00:01 +01:00
Achim Ledermüller
eec3c9505a disabling pg_hba_conf_defaults should not disable ipv4acls and ipv6acls rules 2015-05-28 15:37:02 +02:00
dirkweinhardt
d9cc161595 Made title of psql resource for schema creation unique. 2015-05-19 10:12:28 +02:00
Bryan Jen
eb75ec2e36 Merge pull request #609 from hunner/antaflos-patch-2
Antaflos patch 2
2015-04-10 16:08:19 -07:00
JT (Jonny)
7e0547fbe5 Merge pull request #602 from buzzdeee/master
Reorder environment and require parameter, to unbreak
2015-03-31 16:45:13 +01:00
David Crome
81b4778b93 (MODULES-1761) Provide defined resource for managing recovery.conf
Currently there is no resource to use for creating the recovery.conf

This resource can create a recovery.conf for replication with all
currently supported parameters
2015-03-30 10:27:55 +02:00
Sebastian Reitenbach
d4713efce1 Reorder environment and require parameter, to unbreak
on OpenBSD puppet 3.7.4, with future parser, and ruby 2.1.5.

Without the change, ran into error:

Info: Loading facts
    Info: Loading facts
    Error: Could not retrieve catalog from remote server: Error 400 on SERVER: I
nvalid parameter environment on Postgresql_psql[CREATE ROLE puppetdb ENCRYPTED P
ASSWORD ****] at /etc/puppet/environments/production/modules/postgresql/manifest
s/server/role.pp:46 on node puppetdb.srv.intern
    Warning: Not using cache on failed catalog
    Error: Could not retrieve catalog; skipping run

I guess the future parser requires adhering to the order?
2015-03-29 13:43:26 +02:00
Reno Reckling
1ecc5bc8dd properly quote create and drop extension statements 2015-03-23 14:06:41 +01:00
Andreas Ntaflos
863a4b80de Fix setting postgres role password
Discussed in https://tickets.puppetlabs.com/browse/MODULES-1869

It seems env variables passed via `exec`'s `environment` parameter must
not be single-quoted, otherwise the single-quotes are interpreted
literally in the command strings in `command` and `unless`. For a
postgres password of `foobar` this leads to the `unless` code trying to
use literally `'foobar'` as password, and the `psql` line in `command`
setting literally `'$$foobar$$'` as password.
2015-03-19 03:16:27 +01:00
Ruben van Staveren
05c466c9d0 Provide postgresql_psql defaults for postgresql::server::initdb 2015-03-16 21:30:21 +01:00
Ruben van Staveren
977a7495f8 Fix indentation to 2 spaces 2015-03-16 21:22:08 +01:00
Ruben van Staveren
01b38f5bb4 postgresql::server::extension needs to have defaults for postgresql_psql
Using same pattern as with postgresql::server::database.
observed when installing the pg_trgm using pgsql 9.4
2015-03-16 21:22:07 +01:00
Krzysztof Suszyński
cfbf2f9308 Using enviromental varables to hide actual password in psql commands displayed in output and reports. 2015-03-12 10:57:19 -07:00
Colin Wood
83b4ac1661 Allow management of logdir and add logdir parameter 2015-03-12 10:40:46 -07:00
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