module-postgresql/manifests
Matthaus Owens 82c5863431 Update status for postgres service on Debian
The postgresql init script on debian/ubuntu returns 0 no matter whether postgresql is started or stopped, so puppet has no way of knowing whether to start postgresql when the service is set to 'ensure => running'. This commit adds a param to the params class called $service_status which is set to the status piped to an egrep on debian/ubuntu, which reliably returns 0 if there are clusters running and 1 if there are none. The output before and after this patch can be seen below. If the init script is fixed at some point, the logic would need to be revisited.

Before patch postgresql remains stopped after puppet run.

$ # service postgresql stop
$ #   * Stopping PostgreSQL 9.1 database server
$ # puppet apply -e "class {'postgresql::server':}"
$ #   notice: Finished catalog run in 0.15 seconds
$ # service postgresql status
$ #   Running clusters:

After patch postgresql is started after puppet run.

$ # service postgresql stop
$ #   * Stopping PostgreSQL 9.1 database server
$ # puppet apply -e "class {'postgresql::server':}"
$ #   notice: /Stage[main]/Postgresql::Server/Service[postgresqld]/ensure: ensure changed 'stopped' to 'running'
$ #   notice: Finished catalog run in 2.26 seconds
$ # service postgresql status
$ #   Running clusters: 9.1/main
2012-09-28 15:53:33 -07:00
..
config Remove trailing commas. 2012-08-25 03:20:27 +02:00
config.pp Remove trailing commas. 2012-08-25 03:20:27 +02:00
database.pp Try to make the pg_hba.conf work on postgres 8.1 2012-07-19 18:02:12 -07:00
database_grant.pp Remove trailing commas. 2012-08-25 03:20:27 +02:00
database_user.pp Add a type for validating a postgres connection 2012-09-14 13:26:28 -07:00
db.pp Add postgresql::db convenience type, improve security 2012-06-09 09:23:11 -07:00
init.pp Working version of postgresql::server 2012-06-08 13:37:21 -07:00
initdb.pp Working version of postgresql::server 2012-06-08 13:37:21 -07:00
params.pp Update status for postgres service on Debian 2012-09-28 15:53:33 -07:00
psql.pp Try to make the pg_hba.conf work on postgres 8.1 2012-07-19 18:02:12 -07:00
role.pp Bring database, database_user, and database_grant into alignment with mysql module 2012-06-08 22:30:27 -07:00
server.pp Update status for postgres service on Debian 2012-09-28 15:53:33 -07:00
validate_db_connection.pp Add a type for validating a postgres connection 2012-09-14 13:26:28 -07:00