Commit graph

18 commits

Author SHA1 Message Date
Ken Barber
86a0453f2f Provide new defined resources for managing pg_hba.conf
This patch provides a more advanced way of managing pg_hba rules, by providing a
defined resource to manage a pg_hba file, and a defined resource for managing
rules within such a file (pg_hba_rule).

These new resources are wrappers around ripinaar-concat, and utilise file
assemblies instead of a template to compose the pg_hba.conf file.

I've provided a function that interprets the old ip4|6acl arrays and converts
them to this new format for backwards compatibility as well.

I slightly reformatted our documentation to allow for better documentation of
defined resources in 'Usage' as well, and provided examples of how to use this
new resource.

This hopefully should go a long way to solving the PR's related to lack of full
functionality for pg_hba.conf.

Signed-off-by: Ken Barber <ken@bob.sh>
2013-02-12 00:34:42 +00:00
fhrbek
10cb81468e Coding style fixes 2013-02-06 18:51:58 +01:00
Karel Brezina
db93a91283 Added test of the included postgresql configuration file 2013-02-01 09:41:50 +01:00
Karel Brezina
9114490e9d Tablespacing improvements 2013-01-29 14:05:15 +01:00
Karel Brezina
fad93fbeea Added support for tablespaces 2013-01-28 18:01:11 +01:00
Ken Barber
5963a0a4b9 Fix examples for specifying usage of official postgresql repos
This changes the wording and name of the example for using
yum|apt.postgresql.org as the source of your packages.

Signed-off-by: Ken Barber <ken@bob.sh>
2013-01-15 11:00:24 -08:00
Chris Price
a8e66e6872 Update uses of 'postgresql' to 'postgresql::client' 2013-01-11 14:26:27 -08:00
Chris Price
45669b7f8b Add remaining params to init.pp, and update tests 2013-01-11 14:23:56 -08:00
Chris Price
228e5c5337 Cleanup and move control of version into params
Thanks to some tricks I learned from Nan Liu and Dan Bode, I was
able to figure out a way to move all of the new version-related stuff
back into the params class, and clean up some of the if/_real stuff.

Basic tests for centos6 + pg 9.2 are passing.
2012-12-04 14:12:41 -08:00
Chris Price
fa24f24397 Re-add support for managing yumrepo
This commit creates a new class called `package_source_info`,
which has some initial framework for managing the postgresql.org
yumrepo.  It also serves as a container for the 'version'
variable that is needed by the 'platform' class in order to
use other versions of postgres besides the system default.
2012-12-02 23:06:36 -08:00
William Van Hevelingen
bdf6c0b84c Puppet lint fixes
- left longer than 80 char warnings
 - left inherits params class warnings
2012-11-03 02:37:20 +00:00
William Van Hevelingen
65f8d27f11 Fix typo in server smoke test 2012-11-03 01:34:06 +00:00
dharwood
555f3e9838 typos in readme and test/server.pp 2012-10-22 12:41:05 -07:00
dharwood
b8389d19ad ACLs functioning, added examples in README and test, comments in config manifests 2012-10-22 12:34:24 -07:00
Chris Price
1175ea20d6 Add postgresql::db convenience type, improve security
This commit adds a postgresql::db type for convenience;
it mirrors the 'db' type from the mysql module, which
allows you to create a database instance and user plus
grant privileges to that user all in one succint
resource.

This commit also improves security in the following ways:

* Revoke "CONNECT" privilege from the 'public' role for
  newly created databases; without this, any database
  created via this module will allow connections from
  any database user, and will allow them to do things
  like create tables.

* Change to a 'reject'-based policy for dealing with
  remote connections by the postgres user in pg_hba.conf.
  Prior to this commit, if you tried to restrict access
  to the postgres user by IP, the rule would simply not
  match for disallowed IPs; then it would fall through
  to the rule for "all" users, which could still match
  and thus allow the postgres user to connect remotely.
2012-06-09 09:23:11 -07:00
Chris Price
45055d324c Bring database, database_user, and database_grant into alignment with mysql module
Renamed a few files and made some tweaks to try to get
database_grant, database_user, and database types into
a state where they work very similarly to the ones in
the mysql module.  Also introduced a "postgresql_password"
function that can be used to generate an md5 password
hash for a postgres user.
2012-06-08 22:30:27 -07:00
Chris Price
ba802475ff Improve configuration for initial postgres install
This commit adds some configuration management for
postgres, to allow users to get a more complete
setup from their initial install.  Prior to this
commit, we were basically only ensuring that the
package was installed and the service was running.

Now, we support limited configuration for the
pg_hba.conf file to enable md5 authentication for
remote hosts, and for the postgresql.conf file
to specify the listener addresses where TCP
connections should be accepted.  Without these
two changes the initial postgres configuration
doesn't allow *any* connections from outside of the
local host.

This commit also adds an option for opening up the
postgres port in the firewall on redhat-based systems,
and an option to allow setting the password for the
'postgres' database user.

As of this commit, this module now has dependencies
on puppetlabs-stdlib (version > 2.3.4, which includes
the new 'match' parameter for the 'file_line' resource
type), and on puppetlabs-firewall.
2012-06-08 14:00:24 -07:00
Chris Price
6034e122de Working version of postgresql::server
This is a first working version of postgresql::server.
It includes a very simple test manifest, which has
been tried out on CentOS6 and Ubuntu 10.04; initial
tests were successful both from a clean state and
for subsequent runs.

Includes a new fact called 'postgres_default_version',
which detects what the default version of postgres is
for a given OS.  This is needed because some of the
commands and directory names include this version string.

Current implementation *only* supports managing the
system default version; in the future it would be nice
to allow the user to explicitly specify a postgres version,
but that isn't yet supported.

The "postgresql::server" class includes a call to postgres's
initdb command on redhat systems, because they don't do
this automatically when the package is installed.
2012-06-08 13:37:21 -07:00