Commit graph

75 commits

Author SHA1 Message Date
David Schmitt
cf5140777b Update to newest modulesync_configs [9ca280f] 2016-04-18 20:15:09 +01:00
Hunter Haugen
9f1cf29857 Merge pull request #730 from puppetlabs/4.7.x
4.7.x mergeback to master
2016-02-03 15:37:40 -08:00
Hunter Haugen
7e27a989c0 Fix quoting 2016-02-02 10:51:20 -08:00
Hunter Haugen
f7dfa262dc Merge pull request #727 from supercow/quote_owner
(MODULES-3024) Quote database objects when creating databases
2016-02-01 15:23:14 -08: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
Helen Campbell
9004ad5747 Changelog, metadata and nodeset update for 4.7.0 2016-02-01 14:35:15 +00:00
Sebastian Gerhards
2a78c474a3 Fix postgresql::server acceptance test descriptions
The descriptions of the acceptance tests should match the class under
test, i.e. postgresql::server.
2016-01-28 15:26:14 +01:00
David Schmitt
8ce98ad9a1 (MAINT) do not run the multi-node tests by default 2015-08-27 16:02:36 +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
Bryan Jen
3e6a22d166 fixes postgresql::server:recovery acceptance tests 2015-07-01 14:13:29 -07:00
Bryan Jen
2514881d3d adds acceptance tests for postgresql::server::recovery resource 2015-07-01 14:13:29 -07: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
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
Hunter Haugen
c0da35cb00 Add acceptance test 2015-04-10 14:28:18 -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
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
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
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
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
juniorsysadmin
435d63297a (MODULES-1153) Add database comment parameter 2015-02-04 22:45:28 +11: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
Ashley Penney
6497404eb5 Revert "Support changing PGDATA on RedHat" 2014-08-29 15:38:30 -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
a18d56067e This seems to fix up selinux for tablespace. 2014-08-01 14:56:25 -04: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
6a105f3c97 Rework the acceptance and unit tests. 2014-07-09 16:39:04 -04:00
Ashley Penney
d7b95e5e1b Remove all the old acceptance tests. 2014-07-09 16:38:53 -04:00
Ashley Penney
61bde22f68 Fix trailing }. 2014-06-26 14:27:57 -04:00
Colleen Murphy
c63a7ba857 Sync files 2014-06-25 17:23:35 -07:00
Ashley Penney
5735eea1ac Add workaround for selinux. 2014-06-24 11:11:03 -04:00
Ashley Penney
8db4a0cf67 Fix Ubuntu 14.04 tests for now.
This doesn't fix the root cause of the issue, such as the fact that
dpkg can't do wildcard removals, and the uninstall fails when you're
passing in a version number like this, but THIS test doesn't care, it
just wants to make sure the deprecation warning appears in the first
place.

This does however make the tests pass on 14.04.
2014-06-03 13:21:45 -04:00
Dominic Cleal
b7cbe60d4b (MODULES-775) Fix refresh/unless parameter interactions
Interactions between resource refreshes and the 'unless' parameter have been
fixed to follow the behaviour of the 'exec' type.

The 'unless' parameter is now always taken into account, whether in ordinary
operation, during a refresh, or when refreshonly is set to true.  The resource
will not run the SQL command when the 'unless' clause matches a row.

Previously a refresh on a resource would ignore the 'unless' parameter if set
which could cause a failure re-running a command, such as attempting to create
a role that already exists.

The following examples have been fixed:

  * should not run SQL when refreshed and the unless query returns rows
  * with refreshonly should not run SQL when the unless query returns no rows
  * with refreshonly should not run SQL when refreshed and the unless query
    returns rows

This is done by moving the logic for refreshonly and whether to run the SQL
command from the provider into the type, and consolidating it in the
should_run_sql method which is called during 'command' property retrieval
(instead of sync) and during refresh.
2014-06-03 10:25:13 +01:00
Ashley Penney
706eb884eb Remove eq('') tests thanks to the new deprecation warnings. 2014-05-29 12:09:08 -04:00
Ashley Penney
bd1eec24d0 Merge branch '3.3.x' into merge33x 2014-05-13 21:08:41 +02:00
Morgan Haskel
d51e9779f0 Need to flush iptables on rhel5. 2014-05-13 14:07:46 -04:00
Morgan Haskel
f004ca39f3 If we're just testing for a warning no need to start up the services. 2014-05-13 12:10:44 -04:00
Morgan Haskel
46d3717c34 Fix validate_db_connection_spec.
The for loop inside the shell() was confusing things (although it's unclear why.  I don't think we need to be looping in the spec, and this works.
2014-05-12 21:00:13 -04:00
Ashley Penney
66651d4ad5 Make sure that the location for 12.04 is set.
This is really clumsy and we need a better way.
2014-05-10 02:14:38 +02:00
Ashley Penney
6b929da99f Fix tests on Centos. 2014-05-09 18:30:34 -04:00
Ashley Penney
e947e96e79 Fix the way we remove postgresql::client. 2014-05-09 16:36:31 -04:00
Ashley Penney
b7685998b6 Various fixes to the tests. 2014-05-09 15:28:19 -04:00
Ashley Penney
4e002d7fd9 Make sure we continue working post 7.0. 2014-05-08 16:52:04 -04:00
Ashley Penney
06f1727336 Various test updates to handle RHEL7 better. 2014-05-08 16:48:57 -04:00