diff options
-rw-r--r-- | manifests/mirror_db.pp | 16 |
1 files changed, 16 insertions, 0 deletions
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}"] + } +} |