summaryrefslogtreecommitdiff
path: root/puppet/modules/couchdb/manifests/query.pp
blob: 9507ca1edcf2ec8e3a05c0640a785ae6909ce9c3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
define couchdb::query (
  $cmd, $path,
  $netrc='/etc/couchdb/couchdb.netrc',
  $host='127.0.0.1:5984',
  $data = '{}',
  $unless = undef) {

  exec { "/usr/bin/curl -s --netrc-file ${netrc} -X ${cmd} ${host}/${path} --data \'${data}\'":
    require => [ Package['curl'], Exec['wait_for_couchdb'] ],
    unless  => $unless
  }
}