diff options
Diffstat (limited to 'manifests')
-rw-r--r-- | manifests/create_db.pp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/manifests/create_db.pp b/manifests/create_db.pp index f0bed31..afab7b5 100644 --- a/manifests/create_db.pp +++ b/manifests/create_db.pp @@ -1,15 +1,16 @@ -define couchdb::create_db ( $host='127.0.0.1:5984', - $admins="{\"names\": [], \"roles\": [] }", - $readers="{\"names\": [], \"roles\": [] }" ) +define couchdb::create_db ( + $host='127.0.0.1:5984', + $admins="{\"names\": [], \"roles\": [] }", + $readers="{\"names\": [], \"roles\": [] }" ) { Couchdb::Query["create_db_${name}"] -> Couchdb::Document["${name}_security"] couchdb::query { "create_db_${name}": - cmd => 'PUT', - host => $host, - path => $name, - unless => "/usr/bin/curl --netrc-file /etc/couchdb/couchdb.netrc ${host}/${name}" + cmd => 'PUT', + host => $host, + url => $name, + unless => "/usr/bin/curl -s --netrc-file /etc/couchdb/couchdb.netrc ${host}/${name} | grep -q -v '{\"error\":\"not_found\"'" } couchdb::document { "${name}_security": |