diff options
author | Michael Scherer <misc@mageia.org> | 2010-12-07 02:40:23 +0000 |
---|---|---|
committer | Michael Scherer <misc@mageia.org> | 2010-12-07 02:40:23 +0000 |
commit | 327196eaee37984b6ea264efca7158b2adf5971a (patch) | |
tree | d2af050ea60c26801c3e0154564dab237410bbdd /modules | |
parent | 63bbb9f955f13b4950bc36a6e18e90f1d748aec1 (diff) | |
download | puppet-327196eaee37984b6ea264efca7158b2adf5971a.tar puppet-327196eaee37984b6ea264efca7158b2adf5971a.tar.gz puppet-327196eaee37984b6ea264efca7158b2adf5971a.tar.bz2 puppet-327196eaee37984b6ea264efca7158b2adf5971a.tar.xz puppet-327196eaee37984b6ea264efca7158b2adf5971a.zip |
like the user type, add a database type
Diffstat (limited to 'modules')
-rw-r--r-- | modules/postgresql/manifests/init.pp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/modules/postgresql/manifests/init.pp b/modules/postgresql/manifests/init.pp index 9b9e3b18..6765c7e5 100644 --- a/modules/postgresql/manifests/init.pp +++ b/modules/postgresql/manifests/init.pp @@ -68,6 +68,14 @@ class postgresql { require => Package["postgresql-server"], } + # TODO convert it to a regular type ( so we can later change user and so on ) + define database($description="", $user="postgres") { + exec { "createdb -U postgres $name '$description'": + user => root, + unless => "psql -l -U postgres | grep '^$name|'", + } + } + define user($password) { $sql = "CREATE ROLE $name ENCRYPTED PASSWORD '$password' NOSUPERUSER NOCREATEDB NOCREATEROLE INHERIT LOGIN;" |