summaryrefslogtreecommitdiff
path: root/puppet/modules/site_couchdb/manifests/create_dbs.pp
blob: 4322f773555d8fd00b5dac15f83ff7b89cd3dbb5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
class site_couchdb::create_dbs {

  Class['site_couchdb::setup']
    -> Class['site_couchdb::create_dbs']

  # Couchdb databases

  ### customer database
  ### r/w: webapp,
  couchdb::create_db { 'customers':
    members => "{ \"names\": [\"$site_couchdb::couchdb_webapp_user\"], \"roles\": [\"replication\"] }",
    require => Couchdb::Query::Setup['localhost']
  }

  ## identities database
  ## r: nickserver, leap_mx - needs to be restrict with design document
  ## r/w: webapp
  couchdb::create_db { 'identities':
    members => "{ \"names\": [], \"roles\": [\"replication\", \"identities\"] }",
    require => Couchdb::Query::Setup['localhost']
  }

  ## keycache database
  ## r/w: nickserver
  couchdb::create_db { 'keycache':
    members => "{ \"names\": [], \"roles\": [\"replication\", \"keycache\"] }",
    require => Couchdb::Query::Setup['localhost']
  }

  ## sessions database
  ## r/w: webapp
  couchdb::create_db { 'sessions':
    members => "{ \"names\": [\"$site_couchdb::couchdb_webapp_user\"], \"roles\": [\"replication\"] }",
    require => Couchdb::Query::Setup['localhost']
  }

  ## shared database
  ## r/w: soledad
  couchdb::create_db { 'shared':
    members => "{ \"names\": [\"$site_couchdb::couchdb_soledad_user\"], \"roles\": [\"replication\"] }",
    require => Couchdb::Query::Setup['localhost']
  }

  ## tickets database
  ## r/w: webapp
  couchdb::create_db { 'tickets':
    members => "{ \"names\": [\"$site_couchdb::couchdb_webapp_user\"], \"roles\": [\"replication\"] }",
    require => Couchdb::Query::Setup['localhost']
  }

  ## tokens database
  ## r: soledad - needs to be restricted with a design document
  ## r/w: webapp
  couchdb::create_db { 'tokens':
    members => "{ \"names\": [], \"roles\": [\"replication\", \"tokens\"] }",
    require => Couchdb::Query::Setup['localhost']
  }

  ## users database
  ## r/w: webapp
  couchdb::create_db { 'users':
    members => "{ \"names\": [], \"roles\": [\"replication\", \"users\"] }",
    require => Couchdb::Query::Setup['localhost']
  }

  ## messages db
  ## store messages to the clients such as payment reminders
  ## r/w: webapp
  couchdb::create_db { 'messages':
    members => "{ \"names\": [\"$site_couchdb::couchdb_webapp_user\"], \"roles\": [\"replication\"] }",
    require => Couchdb::Query::Setup['localhost']
  }
}