summaryrefslogtreecommitdiff
path: root/manifests/add_user.pp
diff options
context:
space:
mode:
authorvarac <varacanero@zeromail.org>2013-03-10 16:27:02 +0100
committervarac <varacanero@zeromail.org>2013-03-10 16:32:19 +0100
commit943e3706c71485b9e1487140eedc81bec1b7254b (patch)
tree4561eaa3e15e33049202362093943dcdb1cddfeb /manifests/add_user.pp
parentd08b3bdcb54e8991fe418ed6401ceffb77441b34 (diff)
adding users: use different port when using bigcouch
Diffstat (limited to 'manifests/add_user.pp')
-rw-r--r--manifests/add_user.pp16
1 files changed, 12 insertions, 4 deletions
diff --git a/manifests/add_user.pp b/manifests/add_user.pp
index 26fc5dc..e455124 100644
--- a/manifests/add_user.pp
+++ b/manifests/add_user.pp
@@ -1,7 +1,15 @@
-define couchdb::add_user ( $roles, $pw, $host='127.0.0.1:5984' ) {
+define couchdb::add_user ( $roles, $pw ) {
+
+ if $::couchdb::bigcouch == true {
+ $port = 5986
+ } else {
+ $port = 5984
+}
+
couchdb::update { "update_user_$name":
- db => '_users',
- id => "org.couchdb.user:$name",
- data => "{\"type\": \"user\", \"name\": \"$name\", \"roles\": $roles, \"password\": \"$pw\"}",
+ port => $port,
+ db => '_users',
+ id => "org.couchdb.user:$name",
+ data => "{\"type\": \"user\", \"name\": \"$name\", \"roles\": $roles, \"password\": \"$pw\"}",
}
}