diff options
Diffstat (limited to 'manifests/bigcouch.pp')
-rw-r--r-- | manifests/bigcouch.pp | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/manifests/bigcouch.pp b/manifests/bigcouch.pp new file mode 100644 index 0000000..67d8691 --- /dev/null +++ b/manifests/bigcouch.pp @@ -0,0 +1,52 @@ +class couchdb::bigcouch inherits couchdb::base { + + case $::operatingsystem { + Debian: { + case $::lsbdistcodename { + /squeeze|wheezy/: { #include couchdb::bigcouch::debian + } + default: { fail "bigcouch not available for ${::operatingsystem}/${::lsbdistcodename}" } + } + } + default: { fail "bigcouch not available for ${::operatingsystem}/${::lsbdistcodename}" } + } + + apt::sources_list {'bigcouch-cloudant.list': + content => "deb http://packages.cloudant.com/debian $::lsbdistcodename main" + } + + # currently, there's no other way with puppet to install unauthenticated + # pacakges: http://projects.puppetlabs.com/issues/556 + # so we need to globally allow apt to install unauthenticated + # packages. + + apt::apt_conf { 'allow_unauthenticated': + content => 'APT::Get::AllowUnauthenticated yes;', + } + + file {'/etc/couchdb': + ensure => link, + target => '/opt/bigcouch/etc' + } + + Package ['couchdb'] { + name => 'bigcouch', + require => [ Apt::Sources_list ['bigcouch-cloudant.list'], + Apt::Apt_conf ['allow_unauthenticated'], File['/etc/couchdb'], + Exec[refresh_apt] ] + } + + file { '/opt/bigcouch/etc/vm.args': + content => template('couchdb/bigcouch/vm.args'), + mode => '0640', + owner => 'bigcouch', + group => 'bigcouch', + require => Package['couchdb'] + } + + Service ['couchdb'] { + provider => 'runit', + name => 'bigcouch' + } + +} |