Fix NOREPLICATION option for Postgres 9.1
Fixing a bug when using this module with Postgresql 9.1 that causes alter role statements to execute during every apply.
This commit is contained in:
parent
68e0a6cc03
commit
694c3ffbf7
1 changed files with 8 additions and 2 deletions
|
@ -56,8 +56,14 @@ define postgresql::server::role(
|
|||
}
|
||||
|
||||
if(versioncmp($version, '9.1') >= 0) {
|
||||
postgresql_psql {"ALTER ROLE \"${username}\" ${replication_sql}":
|
||||
unless => "SELECT rolname FROM pg_roles WHERE rolname='${username}' and rolreplication=${replication}",
|
||||
if $replication_sql == '' {
|
||||
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}",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue