diff options
Diffstat (limited to 'manifests/create_db.pp')
-rw-r--r-- | manifests/create_db.pp | 27 |
1 files changed, 7 insertions, 20 deletions
diff --git a/manifests/create_db.pp b/manifests/create_db.pp index b81dbed..b080b06 100644 --- a/manifests/create_db.pp +++ b/manifests/create_db.pp @@ -1,10 +1,11 @@ define couchdb::create_db ( $host='127.0.0.1:5984', - $admins="{\"names\": [], \"roles\": [] }", - $readers="{\"names\": [], \"roles\": [] }") { + $admins='{\"names\": [], \"roles\": [] }', + $readers='{\"names\": [], \"roles\": [] }' ) +{ - Couchdb::Query["create_db_$name"] -> Couchdb::Query["db_security_${name}"] + Couchdb::Query["create_db_${name}"] -> Couchdb::Query["db_security_${name}"] - couchdb::query { "create_db_$name": + couchdb::query { "create_db_${name}": cmd => 'PUT', host => $host, url => $name, @@ -13,21 +14,7 @@ define couchdb::create_db ( $host='127.0.0.1:5984', couchdb::query { "db_security_${name}": cmd => 'PUT', host => $host, - url => "$name/_security", - data => "{ \"admins\": $admins, \"readers\": $readers }" + url => "${name}/_security", + data => "{ \"admins\": ${admins}, \"readers\": ${readers} }" } - - #couchdb::update { "create_db_$name": - # db => $name, - # id => '', - # data => '' - #} - - #couchdb::update { "db_security_$name": - # db => $name, - # id => '_security', - # data => "{ \"admins\": $admins, \"readers\": $readers }" - #} - - } |