diff options
-rw-r--r-- | manifests/create_db.pp | 13 |
1 files 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}"] } } |