Commit graph

209 commits

Author SHA1 Message Date
Morgan Haskel
f3a17066d1 Merge pull request #593 from cmurphy/rspec-puppet-2
Testing updates
2015-03-24 15:58:01 -04:00
Reno Reckling
1ecc5bc8dd properly quote create and drop extension statements 2015-03-23 14:06:41 +01:00
Colleen Murphy
e049fbc464 Update rspec-puppet tests for 2.0
This patch replaces `subject` with `catalogue` for the raise_error
matchers because `subject` no longer contains Puppet errors. We also
unpin rspec-puppet.
2015-03-19 13:55:26 -07:00
Morgan Haskel
8053ea7232 Fix acceptance tests for EL
The return value of fact('selinux') is a stringified bool.
2015-03-17 16:35:31 -07:00
Hunter Haugen
c323cea12a Fix specs for #567 2015-03-13 14:20:26 -07:00
Hunter Haugen
6b8c3a9526 Don't make change to .gitignore
It will be stomped on by modulesync.

And remove trailing whitespace
2015-03-12 10:58:48 -07:00
Krzysztof Suszyński
a9b16b6ccf I've added some acceptance tests to 100% check that my method is valid and passwords ane not placed in report 2015-03-12 10:57:20 -07:00
Krzysztof Suszyński
5419384473 Fix for not running acceptance tests on CentOS box
This was caused by fact that SELinux is already disabled and `setenforce 0` returns 1 insted of 0 in that case.
2015-03-12 10:57:20 -07: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
Hunter Haugen
a50a16d97d Merge pull request #580 from raphink/dev/replication
Replication type
2015-03-12 10:18:42 -07:00
Raphaël Pinson
76ab6f1160 Add a postgresql_replication_slot type 2015-03-12 18:14:58 +01:00
Morgan Haskel
8295b488cc Revert "(MODULES-661) Add host parameter to psql commands"
This reverts commit d92b2545e2.

Conflicts:
	spec/unit/puppet/provider/postgresql_psql/ruby_spec.rb
2015-03-09 17:00:06 -07:00
Morgan Haskel
593e953bf7 Readme and test updates for service_reload parameter 2015-03-06 14:11:33 -08:00
Peter Souter
d1c2144b74 (MAINT) Fixes incorrect rspec it description
Copy-paste error from before
2015-03-04 11:57:06 +00:00
Peter Souter
d92b2545e2 (MODULES-661) Add host parameter to psql commands
This allows you to use `postgres_pqsl` commands to be run against a specified host. The ultimate goal being that you can use `puppetlabs-postsgresql` to run against remote instances, especially things such as Amazons RDS service.

This PR will be further extended to do things like allow remote `table_grant` and the like.
2015-03-03 17:13:37 +00: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
0daf411a3e Add an acceptance test to prove that default encoding is wrong on Debian 2015-02-19 08:37:31 +01:00
Hunter Haugen
bfaef511a6 This wasn't matching anything other than psql 8 2015-02-06 08:40:22 -08: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
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
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
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
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
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
Alexander Swen
1fa55ca823 Fix some typo's in Readme and specfile. 2014-09-12 15:03:39 +02:00
Hunter Haugen
df77fe4847 Include postgresql::server class for specs 2014-09-08 15:48:34 -07:00
Ashley Penney
81a85d896f Merge pull request #492 from mhaskel/spec_fix
Force concat install
2014-09-05 18:17:11 -04:00
Morgan Haskel
7084bdb20f Force concat install 2014-09-05 18:16:13 -04:00
Ashley Penney
70ce3f1245 Allow failures. 2014-09-03 10:45:04 -04:00
Ashley Penney
001f3ae6ef Fix the spec helper to apply selinux to agents only. 2014-09-02 19:16:41 -04:00
Ashley Penney
e2944b71fd This can't be refreshonly. 2014-09-02 12:40:34 -04:00
Ashley Penney
6497404eb5 Revert "Support changing PGDATA on RedHat" 2014-08-29 15:38:30 -04:00
Morgan Haskel
ae26f732ea Update spec_helper for more consistency 2014-08-28 17:55:16 -04:00
Ashley Penney
48e1eb6002 Merge pull request #476 from hunner/remove_firewall
Remove firewall management
2014-08-28 13:17:53 -04:00
Martin Jackson
8997ea16c5 Remove bogus -D argument 2014-08-24 08:19:28 -05:00
Martin Jackson
7828cf3f73 Create acceptance test for pgdata 2014-08-21 21:58:11 -05:00
Hunter Haugen
532047919a Remove firewall management
The firewall management really belongs outside of the module that
manages postgresql, like in a profile.
2014-08-21 11:12:23 -07:00
Ashley Penney
7b1147f4fa Merge pull request #450 from jantman/MODULES-1213
MODULES-1213 link pg_config binary into /usr/bin if not already in /usr/bin or /usr/local/bin
2014-08-07 13:11:16 -04:00
Ashley Penney
a18d56067e This seems to fix up selinux for tablespace. 2014-08-01 14:56:25 -04:00
Hunter Haugen
03a51599b1 Merge pull request #456 from igalic/schema
defined type for creating database schemas
2014-07-29 08:05:22 -07:00
txaj
bf328c870b Set manage_pg_ident_conf to false for backward compatibility
I'd like to see this patch included ASAP -- the desirable default could
be manage_pg_ident_conf => true, but one could already manage this file
manually : we don't want to wipe it.

Please switch the default from false to true at the next major release
and write a line about this in the release notes.
2014-07-28 13:00:21 -05:00
txaj
e2b0bdd26f Create the pg_ident_rule defined type
This allows us to declare user map as easilly as pg_hba entries.
2014-07-26 17:14:51 -05:00
Igor Galić
324c291b3f defined type for creating database schemas
This defined type helps create database schemas, and assign them to an
`owner`. It is closely modeled after Postgresql::Server::Tablespace.
It uses PostgreSQL's builtin IF NOT EXISTS to guarantee idempotency.
(>= 9.3, else it checks pg_namespace).

n.b.: This defined type *requires* that a `db` is passed. This is a
concious design decision, since we find it rather useless to create such
schemas in the default `postgres` database, and if *were* useful, one
can always "over-specify".

This addresses MODULES-1098.
2014-07-25 17:10:40 +02:00
Ashley Penney
e2f5015207 Merge 3.4.x changes into master. 2014-07-25 09:31:00 -04:00
Dominic Cleal
0c4f2a9647 Fix Fedora support by configuring systemd, not /etc/sysconfig 2014-07-25 11:40:53 +01:00
Jason Antman
3e5a2c8dc7 MODULES-1213 link pg_config binary into /usr/bin if not already in /usr/bin or /usr/local/bin 2014-07-14 09:59:37 -04:00
Ashley Penney
58fe218e91 Remove the ensure => absent uninstall code.
This is likely to be a controversial change so I wanted to put some
explanation of our reasoning into the commit message.  This gets
kind of complex so I'll start with the problem and then the reasoning.

Problem:

We rely heavily on the ability to uninstall and reinstall postgres
throughout our testing code, testing features like "can I move from the
distribution packages to the upstream packages through the module" and
over time we've learnt that the uninstall code simply doesn't work a lot
of the time.  It leaves traces of postgres behind or fails to remove
certain packages on Ubuntu, and generally causes bits to be left on your
system that you didn't expect.

When we then reinstall things fail because it's not a true clean slate,
and this causes us enormous problems during test.  We've spent weeks and
months working on these tests and they simply don't hold up well across
the full range of PE platforms.

Reasoning:

Due to all these problems we've decided to take a stance on uninstalling
in general.  We feel that in 2014 it's completely reasonable and normal
to have a good provisioning pipeline combined with your configuration
management and the "correct" way to uninstall a fully installed service
like postgresql is to simply reprovision the server without it in the
first place.  As a general rule this is how I personally like to work
and I think is a good practice.

WAIT A MINUTE:

We understand that there are environments and situations in which it's
not easy to do that.  What if you accidently deployed Postgres on
100,000 nodes?  When this work is finished I'm going to take a look at
building some example 'profiles' to be found under examples/ within this
module that can uninstall postgres on popular platforms.  These can be
modified and used in your specific case to uninstall postgresql.  They
will be much more brute force and reliant on deleting entire directories
and require you to do more work up front in specifying where things are
installed but we think it'll prove to be a much cleaner mechanism for
this kind of thing rather than trying to weave it into the main module
logic itself.
2014-07-12 12:15:42 -04:00
Ashley Penney
6a105f3c97 Rework the acceptance and unit tests. 2014-07-09 16:39:04 -04:00