Skip to content

Commit 879c805

Browse files
committed
fixup postgresql::db
1 parent 231ab5a commit 879c805

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

manifests/db.pp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,19 @@
33
# Usage:
44
#
55
# postgresql::db { 'mydb': }
6-
define postgresql::db($ensure = present) {
6+
define postgresql::db(
7+
$ensure = present
8+
) {
79
require postgresql
810

911
exec { "postgresql-db-${name}":
1012
command => join([
1113
'createdb',
12-
"-p${postgresql::config::port}",
14+
"-p${postgresql::port}",
1315
'-E UTF-8',
14-
"-O ${::boxen_user}",
16+
"-O ${postgresql::user}",
1517
$name
1618
], ' '),
17-
require => Exec['wait-for-postgresql'],
18-
unless => "psql -aA -p${postgresql::config::port} -t -l | cut -d \\| -f 1 | grep -w '${name}'"
19+
unless => "psql -aA -p${postgresql::port} -t -l | cut -d \\| -f 1 | grep -w '${name}'"
1920
}
2021
}

manifests/init.pp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818

1919
$service = $postgresql::params::service,
2020
$enable = $postgresql::params::enable,
21+
22+
$user = $postgresql::params::user,
2123
) inherits postgresql::params {
2224

2325
class { 'postgresql::config':

manifests/params.pp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
$version = '9.2.4-boxen2'
1515

1616
$service = 'dev.postgresql'
17+
18+
$user = $::boxen_user
1719
}
1820

1921
Ubuntu: {
@@ -26,6 +28,8 @@
2628
$version = installed
2729

2830
$service = 'postgresql-9.1'
31+
32+
$user = 'postgresql'
2933
}
3034

3135
default: {

0 commit comments

Comments
 (0)