summaryrefslogtreecommitdiff
path: root/manifests/add_user.pp
blob: e455124787df7ca2a2ec00805d31f349d32b2b82 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
define couchdb::add_user ( $roles, $pw ) {

  if $::couchdb::bigcouch == true {
    $port = 5986
  } else {
    $port = 5984
}

  couchdb::update { "update_user_$name":
    port => $port,
    db   => '_users',
    id   => "org.couchdb.user:$name",
    data => "{\"type\": \"user\", \"name\": \"$name\", \"roles\": $roles, \"password\": \"$pw\"}",
  }
}