diff options
author | Michael Scherer <misc@mageia.org> | 2012-03-17 16:53:49 +0000 |
---|---|---|
committer | Michael Scherer <misc@mageia.org> | 2012-03-17 16:53:49 +0000 |
commit | 4acd57a23e7bb3e641187e5d58b18ae01e78800e (patch) | |
tree | 7b12d476d7f6debd6070a79b7a8b10ae2a1e92b8 /modules | |
parent | 77b85dcffc7e6ba92a619ee4e9bccfe015734f27 (diff) | |
download | puppet-4acd57a23e7bb3e641187e5d58b18ae01e78800e.tar puppet-4acd57a23e7bb3e641187e5d58b18ae01e78800e.tar.gz puppet-4acd57a23e7bb3e641187e5d58b18ae01e78800e.tar.bz2 puppet-4acd57a23e7bb3e641187e5d58b18ae01e78800e.tar.xz puppet-4acd57a23e7bb3e641187e5d58b18ae01e78800e.zip |
split the remaning class of postgresql module into different file, and clean them while on it
Diffstat (limited to 'modules')
-rw-r--r-- | modules/postgresql/manifests/database_callback.pp | 9 | ||||
-rw-r--r-- | modules/postgresql/manifests/db_and_user.pp | 15 | ||||
-rw-r--r-- | modules/postgresql/manifests/init.pp | 74 | ||||
-rw-r--r-- | modules/postgresql/manifests/remote_database.pp | 14 | ||||
-rw-r--r-- | modules/postgresql/manifests/remote_db_and_user.pp | 17 | ||||
-rw-r--r-- | modules/postgresql/manifests/remote_user.pp | 9 |
6 files changed, 65 insertions, 73 deletions
diff --git a/modules/postgresql/manifests/database_callback.pp b/modules/postgresql/manifests/database_callback.pp new file mode 100644 index 00000000..c861eba5 --- /dev/null +++ b/modules/postgresql/manifests/database_callback.pp @@ -0,0 +1,9 @@ +define postgresql::database_callback($callback_notify = '') { + # dummy declaration, so we can trigger the notify + if $callback_notify { + exec { "callback $name": + command => true, + notify => $callback_notify, + } + } +} diff --git a/modules/postgresql/manifests/db_and_user.pp b/modules/postgresql/manifests/db_and_user.pp new file mode 100644 index 00000000..2d59e1ca --- /dev/null +++ b/modules/postgresql/manifests/db_and_user.pp @@ -0,0 +1,15 @@ +define postgresql::db_and_user( $password, + $description = '', + $callback_notify = '') { + + postgresql::database { $name: + callback_notify => $callback_notify, + description => $description, + user => $name, + require => Postgresql::User[$name], + } + + postgresql::user { $name: + password => $password + } +} diff --git a/modules/postgresql/manifests/init.pp b/modules/postgresql/manifests/init.pp index 058d1433..faec8b8c 100644 --- a/modules/postgresql/manifests/init.pp +++ b/modules/postgresql/manifests/init.pp @@ -1,73 +1 @@ -class postgresql { - define remote_db_and_user($description = "", - $tag = "default", - $callback_notify = "", - $password ) { - - @@postgresql::db_and_user { $name: - callback_notify => $callback_notify, - tag => $tag, - description => $description, - password => $password - } - # fetch the exported ressources that should have been exported - # once the db was created, and trigger a notify to the object passwed as callback_notify - Postgresql::Database_callback <<| tag == $name |>> - } - - define remote_database($description = "", - $user = "postgresql", - $callback_notify = "", - $tag = "default") - { - - - @@postgresql::database { $name: - description => $description, - user => $user, - callback_notify => $callback_notify, - tag => $tag, - require => Postgresql::User[$user] - } - - Postgresql::Database_callback <<| tag == $name |>> - } - - define remote_user($password, - $tag = "default") - { - @@postgresql::user { $name: - tag => $tag, - password => $password, - } - } - - define db_and_user($description = "", - $callback_notify = "", - $password ) { - - postgresql::database { $name: - callback_notify => $callback_notify, - description => $description, - user => $name, - require => Postgresql::User[$name], - } - - postgresql::user { $name: - password => $password - } - - } - - define database_callback($callback_notify = '') { - # dummy declaration, so we can trigger the notify - if $callback_notify { - exec { "callback $name": - command => "true", - notify => $callback_notify, - } - } - } - - -} +class postgresql { } diff --git a/modules/postgresql/manifests/remote_database.pp b/modules/postgresql/manifests/remote_database.pp new file mode 100644 index 00000000..57d35a9b --- /dev/null +++ b/modules/postgresql/manifests/remote_database.pp @@ -0,0 +1,14 @@ +class postgresql::remote_database($description = '', + $user = 'postgresql', + $callback_notify = '', + $tag = 'default') { + @@postgresql::database { $name: + description => $description, + user => $user, + callback_notify => $callback_notify, + tag => $tag, + require => Postgresql::User[$user], + } + + Postgresql::Database_callback <<| tag == $name |>> +} diff --git a/modules/postgresql/manifests/remote_db_and_user.pp b/modules/postgresql/manifests/remote_db_and_user.pp new file mode 100644 index 00000000..bb331304 --- /dev/null +++ b/modules/postgresql/manifests/remote_db_and_user.pp @@ -0,0 +1,17 @@ +define postgresql::remote_db_and_user($password, + $description = '', + $tag = 'default', + $callback_notify = '') { + + @@postgresql::db_and_user { $name: + callback_notify => $callback_notify, + tag => $tag, + description => $description, + password => $password, + } + + # fetch the exported ressources that should have been exported + # once the db was created, and trigger a notify to the object + # passed as callback_notify + Postgresql::Database_callback <<| tag == $name |>> +} diff --git a/modules/postgresql/manifests/remote_user.pp b/modules/postgresql/manifests/remote_user.pp new file mode 100644 index 00000000..ed2bf033 --- /dev/null +++ b/modules/postgresql/manifests/remote_user.pp @@ -0,0 +1,9 @@ +define postgresql::remote_user( $password, + $tag = 'default') { + @@postgresql::user { $name: + tag => $tag, + password => $password, + } +} + + |