From 5b0374f4f3580dda8984667e26694d16e8a8dd42 Mon Sep 17 00:00:00 2001 From: varac Date: Sat, 19 Jan 2013 09:48:36 +0100 Subject: add_user: moved to update script --- manifests/add_user.pp | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) (limited to 'manifests') diff --git a/manifests/add_user.pp b/manifests/add_user.pp index 560a6a8..26fc5dc 100644 --- a/manifests/add_user.pp +++ b/manifests/add_user.pp @@ -1,16 +1,7 @@ -define couchdb::add_user ($host='127.0.0.1:5984', $roles, $pw ) { - couchdb::query { "create_user_$name": - cmd => 'PUT', - host => $host, - url => "_users/org.couchdb.user:$name", - data => "{ \"_id\": \"org.couchdb.user:$name\", \"type\": \"user\", \"name\": \"$name\", \"roles\": $roles, \"password\": \"$pw\"}", +define couchdb::add_user ( $roles, $pw, $host='127.0.0.1:5984' ) { + couchdb::update { "update_user_$name": + db => '_users', + id => "org.couchdb.user:$name", + data => "{\"type\": \"user\", \"name\": \"$name\", \"roles\": $roles, \"password\": \"$pw\"}", } - # - # couchdb::update { "update_user_$name": - # db => "_users", - # id => "org.couchdb.user:$name", - # data => "{\"type\": \"user\", \"name\": \"$name\", \"roles\": $roles, \"password\": \"$pw\"}", - # } - # } - -- cgit v1.2.3