Merge pull request #333 from brandonwamboldt/fix-pg91

Fix NOREPLICATION option for Postgres 9.1
This commit is contained in:
Ashley Penney 2014-01-08 07:05:15 -08:00
commit 7bd0d82fc2

View file

@ -56,8 +56,14 @@ define postgresql::server::role(
} }
if(versioncmp($version, '9.1') >= 0) { if(versioncmp($version, '9.1') >= 0) {
postgresql_psql {"ALTER ROLE \"${username}\" ${replication_sql}": if $replication_sql == '' {
unless => "SELECT rolname FROM pg_roles WHERE rolname='${username}' and rolreplication=${replication}", postgresql_psql {"ALTER ROLE \"${username}\" NOREPLICATION":
unless => "SELECT rolname FROM pg_roles WHERE rolname='${username}' and rolreplication=${replication}",
}
} else {
postgresql_psql {"ALTER ROLE \"${username}\" ${replication_sql}":
unless => "SELECT rolname FROM pg_roles WHERE rolname='${username}' and rolreplication=${replication}",
}
} }
} }