summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvarac <varacanero@zeromail.org>2013-08-29 12:16:01 +0200
committervarac <varacanero@zeromail.org>2013-08-29 19:24:38 +0200
commit61eca267cb52252371a71926a64d7f3b7350489d (patch)
tree17f164630a9bd4b5e5e2e42e29f7780c8e0b4a9e
parent869ea732363afa238055c59baad5d5ca83c38024 (diff)
puppet couchdb module doesn't create necessary databases anymore (Bug #3594)
-rw-r--r--manifests/create_db.pp15
1 files changed, 8 insertions, 7 deletions
diff --git a/manifests/create_db.pp b/manifests/create_db.pp
index 91c4a1d..22b3236 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::Query["db_security_${name}"]
couchdb::query { "create_db_${name}":
- cmd => 'PUT',
- host => $host,
- url => $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::query { "db_security_${name}":