summaryrefslogtreecommitdiff
path: root/manifests/mirror_db.pp
blob: c2e5b217c8313f0c2ce2b19664879c943cc4c9a2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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}"]
  }
}