Commit graph

183 commits

Author SHA1 Message Date
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
Ashley Penney
0ee1b9a2ea Convert specs to RSpec 2.99.1 syntax with Transpec
This conversion is done by Transpec 2.3.1 with the following command:
    transpec -f -c "bundle exec rake spec"

* 82 conversions
    from: it { should ... }
      to: it { is_expected.to ... }

* 21 conversions
    from: == expected
      to: eq(expected)

* 20 conversions
    from: obj.should
      to: expect(obj).to

* 5 conversions
    from: its([:key]) { }
      to: describe '[:key]' do subject { super()[:key] }; it { } end

* 1 conversion
    from: it { should_not ... }
      to: it { is_expected.not_to ... }

* 1 conversion
    from: its(:attr) { }
      to: describe '#attr' do subject { super().attr }; it { } end

For more details: https://github.com/yujinakayama/transpec#supported-conversions
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
5d4ecb1b04 Merge pull request #413 from rdark/support/jdbc_repo_dependency
tag postgresql-jdbc package to fix package repo dependency
2014-06-05 13:37: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
192ea5e3f3 Fix service_ensure.
We now test if service_ensure is 'running' or 'stopped' but it was
actually picking up the default value of ensure in params.pp which
was true, not present.

Fix this and thereby fix the failing test.
2014-05-12 23:34:25 +02:00
Ashley Penney
f37b3a6ba5 Fixes broken tests and add a service_ensure test. 2014-05-12 23:25:05 +02: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
05b77232f9 Allow psql to fail as it sometimes will in the tests. 2014-05-09 15:28:30 -04:00
Ashley Penney
b7685998b6 Various fixes to the tests. 2014-05-09 15:28:19 -04:00
Richard Clark
063582a986 remove trailing commas 2014-05-09 14:11:37 +01:00
Richard Clark
25b11a2e6b tag postgresql-jdbc package to fix package repo dependency 2014-05-09 14:01:15 +01:00
Ashley Penney
4e002d7fd9 Make sure we continue working post 7.0. 2014-05-08 16:52:04 -04:00
Ashley Penney
3205359afe Make sure we set selinux contexts on Redhat. 2014-05-08 16:49:25 -04:00
Ashley Penney
06f1727336 Various test updates to handle RHEL7 better. 2014-05-08 16:48:57 -04:00
Hunter Haugen
21001d5b0c (MODULES-630) Deprecate postgresql::server::version
Adjusting the version is explicitly done though the postgresql::globals
class, as this affects many parts of the module. This parameter did not
function correctly on systems that did not have a default, as described
in the ticket.
2014-05-07 15:25:18 -07:00