/[adm]/puppet/modules/postgresql/manifests/user.pp
ViewVC logotype

Contents of /puppet/modules/postgresql/manifests/user.pp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2582 - (show annotations) (download)
Sat Mar 17 16:53:39 2012 UTC (12 years ago) by misc
File size: 549 byte(s)
split postgresql::user in a separate file
1 # TODO convert to a regular type, so we can later change password
2 # without erasing the current user
3 define postgresql::user($password) {
4 $sql = "CREATE ROLE $name ENCRYPTED PASSWORD '\$pass' NOSUPERUSER NOCREATEDB NOCREATEROLE INHERIT LOGIN;"
5
6 exec { "psql -U postgres -c \"$sql\" ":
7 user => 'root',
8 # do not leak the password on commandline
9 environment => "pass=$password",
10 unless => "psql -A -t -U postgres -c '\\du $name' | grep '$name'",
11 require => Service['postgresql'],
12 }
13 }

  ViewVC Help
Powered by ViewVC 1.1.30