Skip to content

Commit

Permalink
Merge pull request puppetlabs#333 from brandonwamboldt/fix-pg91
Browse files Browse the repository at this point in the history
Fix NOREPLICATION option for Postgres 9.1
  • Loading branch information
Ashley Penney committed Jan 8, 2014
2 parents e2512d7 + 08d21a3 commit 1e91af3
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions manifests/server/role.pp
Expand Up @@ -56,8 +56,14 @@
}

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}",
}
}
}

Expand Down

0 comments on commit 1e91af3

Please sign in to comment.