From 75e62f1aa97b6702b82d28ddc768a92c0a831b5c Mon Sep 17 00:00:00 2001 From: Azul Date: Thu, 19 Jun 2014 20:04:38 +0200 Subject: first stab at replicating couch nodes from should probably be a local port and we should use stunnels to connect to the master --- manifests/mirror_db.pp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 manifests/mirror_db.pp diff --git a/manifests/mirror_db.pp b/manifests/mirror_db.pp new file mode 100644 index 0000000..c2e5b21 --- /dev/null +++ b/manifests/mirror_db.pp @@ -0,0 +1,16 @@ +define couchdb::mirror_db ( + $host='127.0.0.1:5984', + $from='', + $to='' ) +{ + $source = "$from$name" + $target = "$to$name" + + couchdb::document { "${name}_replication": + db => "_replicate", + id => "${name}_replication", + host => $host, + data => "{ \"source\": ${source}, \"target\": ${target}, \"continuous\": true }", + require => Couchdb::Query["create_db_${name}"] + } +} -- cgit v1.2.3