summaryrefslogtreecommitdiff
path: root/puppet/modules/site_couchdb/manifests/bigcouch.pp
blob: dd3c0a7fb7b74a56d4f754deb77560a91ec4ef0e (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
# sets up bigcouch on couchdb node
class site_couchdb::bigcouch {

  $config         = $::site_couchdb::couchdb_config['bigcouch']
  $cookie         = $config['cookie']
  $ednp_port      = $config['ednp_port']

  class { 'couchdb':
    admin_pw            => $::site_couchdb::couchdb_admin_pw,
    admin_salt          => $::site_couchdb::couchdb_admin_salt,
    bigcouch            => true,
    bigcouch_cookie     => $cookie,
    ednp_port           => $ednp_port,
    chttpd_bind_address => '127.0.0.1'
  }

  #
  # stunnel must running correctly before bigcouch dbs can be set up.
  #
  Class['site_config::default']
    -> Class['site_config::resolvconf']
    -> Class['couchdb::bigcouch::package::cloudant']
    -> Exec['shorewall_check']
    -> Exec['refresh_stunnel']
    -> Class['site_couchdb::setup']
    -> Class['site_couchdb::bigcouch::add_nodes']
    -> Class['site_couchdb::bigcouch::settle_cluster']
    -> Class['site_couchdb::create_dbs']

  include site_couchdb::bigcouch::add_nodes
  include site_couchdb::bigcouch::settle_cluster
  include site_couchdb::bigcouch::compaction

  file { '/var/log/bigcouch':
    ensure => directory
  }

  file { '/etc/sv/bigcouch/run':
    ensure  => present,
    source  => 'puppet:///modules/site_couchdb/runit_config',
    owner   => root,
    group   => root,
    mode    => '0755',
    require => Package['couchdb'],
    notify  => Service['couchdb']
  }

  include site_check_mk::agent::couchdb::bigcouch

}