diff options
author | varac <varacanero@zeromail.org> | 2013-05-23 21:20:48 +0200 |
---|---|---|
committer | Micah Anderson <micah@riseup.net> | 2013-05-23 17:58:02 -0400 |
commit | 20deb0652ccfe105eddec6ba2ad32b8d633705f6 (patch) | |
tree | 4340211dc0fc0a823a28566f6c3a53ba31ee4dae | |
parent | 0c34d9bd1c51d4e633f92e459b7973008350aefb (diff) |
add couchdb::bigcouch::add_node and couchdb::bigcouch::query
-rw-r--r-- | manifests/bigcouch/add_node.pp | 7 | ||||
-rw-r--r-- | manifests/bigcouch/query.pp | 10 | ||||
-rw-r--r-- | manifests/query.pp | 3 |
3 files changed, 19 insertions, 1 deletions
diff --git a/manifests/bigcouch/add_node.pp b/manifests/bigcouch/add_node.pp new file mode 100644 index 0000000..da10db2 --- /dev/null +++ b/manifests/bigcouch/add_node.pp @@ -0,0 +1,7 @@ +define couchdb::bigcouch::add_node { + + couchdb::bigcouch::query { "add_${name}": + cmd => 'PUT', + url => "nodes/bigcouch@${name}" + } +} diff --git a/manifests/bigcouch/query.pp b/manifests/bigcouch/query.pp new file mode 100644 index 0000000..cecfe5a --- /dev/null +++ b/manifests/bigcouch/query.pp @@ -0,0 +1,10 @@ +define couchdb::bigcouch::query ( + $cmd, $url, $host='127.0.0.1:5986', $data = '{}' ) { + + couchdb::query { "${name}": + cmd => $cmd, + host => $host, + url => $url, + data => $data + } +} diff --git a/manifests/query.pp b/manifests/query.pp index 76ef648..a02d068 100644 --- a/manifests/query.pp +++ b/manifests/query.pp @@ -1,4 +1,5 @@ -define couchdb::query ( $cmd, $url, $host='127.0.0.1:5984', $data = '{}' ) { +define couchdb::query ( + $cmd, $url, $host='127.0.0.1:5984', $data = '{}' ) { exec { "/usr/bin/curl --netrc-file /etc/couchdb/couchdb.netrc -X ${cmd} ${host}/${url} --data \'${data}\'": require => [ Package['curl'], Exec['wait_for_couchdb'] ] |