diff options
author | Azul <azul@riseup.net> | 2013-08-15 11:44:18 +0200 |
---|---|---|
committer | Azul <azul@riseup.net> | 2013-08-28 12:52:14 +0200 |
commit | 16a3583c359cd57ff52866a8dfd933726d120d30 (patch) | |
tree | 6cd32d441d50fab4edb33275b3fb9d55f52cf622 /manifests/create_db.pp | |
parent | fbe74fd5aef6e26070e9b10357604dda3bd2d842 (diff) |
couch:document - ensure state of a couch document - (feature #3485)
also made the use of host, hostname and port a bit more consistent.
Diffstat (limited to 'manifests/create_db.pp')
-rw-r--r-- | manifests/create_db.pp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/manifests/create_db.pp b/manifests/create_db.pp index 91c4a1d..f0bed31 100644 --- a/manifests/create_db.pp +++ b/manifests/create_db.pp @@ -3,19 +3,19 @@ define couchdb::create_db ( $host='127.0.0.1:5984', $readers="{\"names\": [], \"roles\": [] }" ) { - Couchdb::Query["create_db_${name}"] -> Couchdb::Query["db_security_${name}"] + Couchdb::Query["create_db_${name}"] -> Couchdb::Document["${name}_security"] couchdb::query { "create_db_${name}": cmd => 'PUT', host => $host, - url => $name, + path => $name, unless => "/usr/bin/curl --netrc-file /etc/couchdb/couchdb.netrc ${host}/${name}" } - couchdb::query { "db_security_${name}": - cmd => 'PUT', + couchdb::document { "${name}_security": + db => $name, + id => '_security', host => $host, - url => "${name}/_security", data => "{ \"admins\": ${admins}, \"readers\": ${readers} }" } } |