summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvarac <varacanero@zeromail.org>2012-11-03 21:46:51 +0100
committervarac <varacanero@zeromail.org>2012-11-03 21:46:51 +0100
commit0ee2c265ffd4bb4b6e990726d9a111aed114fded (patch)
tree625d26d80b277838fc23543e9b701db125bfe66d
parentb7ed2ad302b03a564db473220728ecfa4d2a09fc (diff)
added create_db.pp
-rw-r--r--manifests/create_db.pp20
1 files changed, 20 insertions, 0 deletions
diff --git a/manifests/create_db.pp b/manifests/create_db.pp
new file mode 100644
index 0000000..112e094
--- /dev/null
+++ b/manifests/create_db.pp
@@ -0,0 +1,20 @@
+define couchdb::create_db ($host,
+ $admins="{\"names\": [], \"roles\": [] }",
+ $readers="{\"names\": [], \"roles\": [] }") {
+
+ Site_couchdb::Query["create_db_$name"] -> Site_couchdb::Query["db_security_${name}"]
+
+ site_couchdb::query { "create_db_$name":
+ cmd => 'PUT',
+ host => $host,
+ url => $name,
+ }
+
+ site_couchdb::query { "db_security_${name}":
+ cmd => 'PUT',
+ host => $host,
+ url => "$name/_security",
+ data => "{ \"admins\": $admins, \"readers\": $readers }"
+ }
+
+}