diff options
-rw-r--r-- | manifests/create_db.pp | 1 | ||||
-rw-r--r-- | manifests/query.pp | 5 |
2 files changed, 4 insertions, 2 deletions
diff --git a/manifests/create_db.pp b/manifests/create_db.pp index 6a6d18f..91c4a1d 100644 --- a/manifests/create_db.pp +++ b/manifests/create_db.pp @@ -9,6 +9,7 @@ define couchdb::create_db ( $host='127.0.0.1:5984', cmd => 'PUT', host => $host, url => $name, + unless => "/usr/bin/curl --netrc-file /etc/couchdb/couchdb.netrc ${host}/${name}" } couchdb::query { "db_security_${name}": diff --git a/manifests/query.pp b/manifests/query.pp index a02d068..1966839 100644 --- a/manifests/query.pp +++ b/manifests/query.pp @@ -1,7 +1,8 @@ define couchdb::query ( - $cmd, $url, $host='127.0.0.1:5984', $data = '{}' ) { + $cmd, $url, $host='127.0.0.1:5984', $data = '{}', $unless = '/bin/false' ) { exec { "/usr/bin/curl --netrc-file /etc/couchdb/couchdb.netrc -X ${cmd} ${host}/${url} --data \'${data}\'": - require => [ Package['curl'], Exec['wait_for_couchdb'] ] + require => [ Package['curl'], Exec['wait_for_couchdb'] ], + unless => $unless } } |