summaryrefslogtreecommitdiff
path: root/manifests
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
parentd08b3bdcb54e8991fe418ed6401ceffb77441b34 (diff)
adding users: use different port when using bigcouch
Diffstat (limited to 'manifests')
-rw-r--r--manifests/add_user.pp16
-rw-r--r--manifests/update.pp4
2 files changed, 14 insertions, 6 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\"}",
}
}
diff --git a/manifests/update.pp b/manifests/update.pp
index 129d875..3cb6ece 100644
--- a/manifests/update.pp
+++ b/manifests/update.pp
@@ -1,3 +1,3 @@
-define couchdb::update ($db, $id, $data) {
- exec { "couch-doc-update --db $db --id $id --data \'$data\'": }
+define couchdb::update ($db, $id, $data, $port='5984') {
+ exec { "couch-doc-update --port $port --db $db --id $id --data \'$data\'": }
}