summaryrefslogtreecommitdiff
path: root/puppet/modules/site_couchdb/manifests/setup.pp
blob: e398356ba7039af91429be91ae8b10e247dd84db (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
#
# An initial setup class. All the other classes depend on this
#
class site_couchdb::setup {

  # ensure that we don't have leftovers from previous installations
  # where we installed the cloudant bigcouch package
  # https://leap.se/code/issues/4971
  class { 'couchdb::bigcouch::package::cloudant':
    ensure => absent
  }

  # /etc/couchdb/couchdb.netrc is deployed by couchdb::query::setup
  # we symlink this to /root/.netrc for couchdb_scripts (eg. backup)
  # and makes life easier for the admin (i.e. using curl/wget without
  # passing credentials)
  file {
    '/root/.netrc':
      ensure  => link,
      target  => '/etc/couchdb/couchdb.netrc';

    '/srv/leap/couchdb':
      ensure => directory
  }

  couchdb::query::setup { 'localhost':
    user  => $site_couchdb::couchdb_admin_user,
    pw    => $site_couchdb::couchdb_admin_pw,
  }

  vcsrepo { '/srv/leap/couchdb/scripts':
    ensure   => present,
    provider => git,
    source   => 'https://leap.se/git/couchdb_scripts',
    revision => 'origin/master',
    require  => File['/srv/leap/couchdb']
  }

}