Skip to content

Commit 0f4c718

Browse files
committed
Merge branch 'cwood-master'
2 parents 9e9aa9d + 83b4ac1 commit 0f4c718

File tree

5 files changed

+23
-1
lines changed

5 files changed

+23
-1
lines changed

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Table of Contents
88
2. [Module Description - What does the module do?](#module-description)
99
3. [Setup - The basics of getting started with PostgreSQL module](#setup)
1010
* [PE 3.2 supported module](#pe-32-supported-module)
11-
* [Configuring the server](#configuring-the-server)
11+
* [Configuring the server](#configuring-the-server)
1212
4. [Usage - How to use the module for various tasks](#usage)
1313
5. [Reference - The classes, defines,functions and facts available in this module](#reference)
1414
6. [Limitations - OS compatibility, etc.](#limitations)
@@ -257,6 +257,9 @@ This setting can be used to override the default postgresql binaries directory f
257257
####`xlogdir`
258258
This setting can be used to override the default postgresql xlog directory. If not specified the module will use initdb's default path.
259259

260+
####`logdir`
261+
This setting can be used to override the default postgresql log directory. If not specified the module will use initdb's default path.
262+
260263
####`user`
261264
This setting can be used to override the default postgresql super user and owner of postgresql related files in the file system. If not specified, the module will use the user name 'postgres'.
262265

manifests/globals.pp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
$confdir = undef,
3030
$bindir = undef,
3131
$xlogdir = undef,
32+
$logdir = undef,
3233

3334
$user = undef,
3435
$group = undef,

manifests/server.pp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333

3434
$datadir = $postgresql::params::datadir,
3535
$xlogdir = $postgresql::params::xlogdir,
36+
$logdir = $postgresql::params::logdir,
3637

3738
$pg_hba_conf_defaults = $postgresql::params::pg_hba_conf_defaults,
3839

manifests/server/config.pp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
$manage_pg_hba_conf = $postgresql::server::manage_pg_hba_conf
1717
$manage_pg_ident_conf = $postgresql::server::manage_pg_ident_conf
1818
$datadir = $postgresql::server::datadir
19+
$logdir = $postgresql::server::logdir
1920

2021
if ($manage_pg_hba_conf == true) {
2122
# Prepare the main pg_hba file
@@ -104,6 +105,12 @@
104105
postgresql::server::config_entry { 'data_directory':
105106
value => $datadir,
106107
}
108+
if $logdir {
109+
postgresql::server::config_entry { 'log_directory':
110+
value => $logdir,
111+
}
112+
113+
}
107114

108115
# RedHat-based systems hardcode some PG* variables in the init script, and need to be overriden
109116
# in /etc/sysconfig/pgsql/postgresql. Create a blank file so we can manage it with augeas later.

manifests/server/initdb.pp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
$initdb_path = $postgresql::server::initdb_path
55
$datadir = $postgresql::server::datadir
66
$xlogdir = $postgresql::server::xlogdir
7+
$logdir = $postgresql::server::logdir
78
$encoding = $postgresql::server::encoding
89
$locale = $postgresql::server::locale
910
$group = $postgresql::server::group
@@ -27,6 +28,15 @@
2728
}
2829
}
2930

31+
if($logdir) {
32+
# Make sure the log directory exists, and has the correct permissions.
33+
file { $logdir:
34+
ensure => directory,
35+
owner => $user,
36+
group => $group,
37+
}
38+
}
39+
3040
if($needs_initdb) {
3141
# Build up the initdb command.
3242
#

0 commit comments

Comments
 (0)