diff options
Diffstat (limited to 'manifests')
-rw-r--r-- | manifests/add_user.pp | 19 |
1 files changed, 5 insertions, 14 deletions
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\"}", - # } - # } - |