diff options
author | Michael Scherer <misc@mageia.org> | 2011-03-22 18:42:46 +0000 |
---|---|---|
committer | Michael Scherer <misc@mageia.org> | 2011-03-22 18:42:46 +0000 |
commit | 57a8a15b3e6a9ac4c678778e1e663e3e1f45e026 (patch) | |
tree | 33fdba072fcbba40de4b5d2283daf4d7ec085870 /modules/postgresql/manifests/init.pp | |
parent | 491f81e3a43ec3429be5d6c79ceda98674dbe62d (diff) | |
download | puppet-57a8a15b3e6a9ac4c678778e1e663e3e1f45e026.tar puppet-57a8a15b3e6a9ac4c678778e1e663e3e1f45e026.tar.gz puppet-57a8a15b3e6a9ac4c678778e1e663e3e1f45e026.tar.bz2 puppet-57a8a15b3e6a9ac4c678778e1e663e3e1f45e026.tar.xz puppet-57a8a15b3e6a9ac4c678778e1e663e3e1f45e026.zip |
convert db_and_user to a exported type
Diffstat (limited to 'modules/postgresql/manifests/init.pp')
-rw-r--r-- | modules/postgresql/manifests/init.pp | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/modules/postgresql/manifests/init.pp b/modules/postgresql/manifests/init.pp index 4894c348..9b01a407 100644 --- a/modules/postgresql/manifests/init.pp +++ b/modules/postgresql/manifests/init.pp @@ -87,6 +87,7 @@ class postgresql { # server Postgresql::User <<| tag == $name |>> Postgresql::Database <<| tag == $name |>> + Postgresql::Db_and_user <<| tag == $name |>> } @@ -94,14 +95,10 @@ class postgresql { $tag = "default", $password ) { - remote_database { $name: - description => $description, - user => $name, - tag => $tag, - } - - remote_user { $name: - password => $password + @@postgresql::db_and_user { $name: + tag => $tag, + description => $description, + password => $password } } @@ -126,6 +123,18 @@ class postgresql { } } + define db_and_user($description = "", + $password ) { + + database { $name: + description => $description, + user => $name, + } + + user { $name: + password => $password + } + } # TODO convert it to a regular type ( so we can later change user and so on ) define database($description="", $user="postgres") { |