From dacaeb4d98be9468336923f5501822d389bda768 Mon Sep 17 00:00:00 2001 From: varac Date: Wed, 4 Sep 2013 09:45:41 +0200 Subject: don't use couchdb::document for creating _security, cause this special doc doesn't have and _id (#3706) --- manifests/create_db.pp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/manifests/create_db.pp b/manifests/create_db.pp index 690892c..32bc974 100644 --- a/manifests/create_db.pp +++ b/manifests/create_db.pp @@ -4,8 +4,6 @@ define couchdb::create_db ( $readers="{\"names\": [], \"roles\": [] }" ) { - Couchdb::Query["create_db_${name}"] -> Couchdb::Document["${name}_security"] - couchdb::query { "create_db_${name}": cmd => 'PUT', host => $host, @@ -13,10 +11,11 @@ define couchdb::create_db ( unless => "/usr/bin/curl -s --netrc-file /etc/couchdb/couchdb.netrc ${host}/${name} | grep -q -v '{\"error\":\"not_found\"'" } - couchdb::document { "${name}_security": - db => $name, - id => '_security', - host => $host, - data => "{ \"admins\": ${admins}, \"readers\": ${readers} }" + couchdb::query { "${name}_security": + cmd => 'PUT', + host => $host, + path => "${name}/_security", + data => "{ \"admins\": ${admins}, \"readers\": ${readers} }", + require => Couchdb::Query["create_db_${name}"] } } -- cgit v1.2.3