Commit graph

225 commits

Author SHA1 Message Date
Bryan Jen
2514881d3d adds acceptance tests for postgresql::server::recovery resource 2015-07-01 14:13:29 -07:00
Bryan Jen
026e4a2fdb Unpins apt 1.8 dependency in fixtures.yml and spec_helper_acceptance. 2015-07-01 14:13:29 -07:00
David Schmitt
e963cd153d (FM-2923) install net-tools for tests
serverspec's be_listening uses net-tools' netstat utility to check for
open ports. This was puleld in until recently by puppet-agent packages.
Now this has changed and we need to install this manually.
2015-06-26 14:13:48 +01:00
Travis Fields
4596b59c01 (maint) Fix tests from #527 merge
- Looks like copy tests mismatched logic of when it should expect changes
2015-06-25 16:48:02 -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
Travis Fields
2aa3217426 (maint) Add beaker-puppet_install_helper and fix fact bug
- Issue with fact() was being called against default instead of
  using fact_on when iterating against each host, also was installing 3.8.1 despite
  specifying PUPPET_VERSION=1.1.1 so updated to use beaker-puppet_install_helper
2015-06-18 15:15:30 -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
tphoney
900b0858c3 pin apt for unit tests
Revert "fixing the unit test."

This reverts commit b8fa36a233.
2015-05-06 17:47:16 +01:00
tphoney
b8fa36a233 fixing the unit test. 2015-04-18 22:04:50 +01:00
Bryan Jen
eb75ec2e36 Merge pull request #609 from hunner/antaflos-patch-2
Antaflos patch 2
2015-04-10 16:08:19 -07:00
Hunter Haugen
c0da35cb00 Add acceptance test 2015-04-10 14:28:18 -07:00
JT (Jonny)
8dbf982b62 Merge pull request #410 from ccin2p3/validate_cmd
Add param for specifying validate connection script in postgresql::client.
2015-03-31 16:55:05 +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
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
Remi Ferrand
995e1983f2 Add param for specifying validate connection script.
* Add param `validcon_path` in `postgresql::client` (defaults to
previous hard coded value).
* Add tests for this new parameter.

All tests runs successfully on Scientific Linux 6.4

```
$ bundle exec rake spec SPEC_OPTS='--format documentation'
[...]

Finished in 2 minutes 10.5 seconds (files took 1.4 seconds to load)
201 examples, 0 failures
```
2015-03-20 12:18:12 +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
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
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