summaryrefslogtreecommitdiff
path: root/puppet/modules/site_couchdb/manifests/configure.pp
blob: 25ea7a0bc05866d5775b2158f1a151636e6cfafa (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
class site_couchdb::configure {
  Class[site_couchdb::package] -> Class[couchdb]

  class { 'couchdb':
    require => Class['site_couchdb::package'], }


  file { '/etc/init.d/couchdb':
    source => 'puppet:///modules/site_couchdb/couchdb',
    mode   => '0755',
    owner  => 'root',
    group  => 'root',
  }

  file { '/etc/couchdb/local.d/admin.ini':
    content => "[admins]
admin = $site_couchdb::couchdb_admin_pw
",
    mode    => '0600',
    owner   => 'couchdb',
    group   => 'couchdb',
    notify  => Service[couchdb]
  }


  exec { '/etc/init.d/couchdb restart; sleep 6':
    path        => ['/bin', '/usr/bin',],
    subscribe   => File['/etc/couchdb/local.d/admin.ini',
      '/etc/couchdb/local.ini'],
    refreshonly => true
  }
}