summaryrefslogtreecommitdiff
path: root/puppet/modules/site_couchdb/manifests
diff options
context:
space:
mode:
authorMicah Anderson <micah@riseup.net>2016-11-04 10:54:28 -0400
committerMicah Anderson <micah@riseup.net>2016-11-04 10:54:28 -0400
commit34a381efa8f6295080c843f86bfa07d4e41056af (patch)
tree9282cf5d4c876688602705a7fa0002bc4a810bde /puppet/modules/site_couchdb/manifests
parent0a72bc6fd292bf9367b314fcb0347c4d35042f16 (diff)
parent5821964ff7e16ca7aa9141bd09a77d355db492a9 (diff)
Merge branch 'develop'
Diffstat (limited to 'puppet/modules/site_couchdb/manifests')
-rw-r--r--puppet/modules/site_couchdb/manifests/add_users.pp3
-rw-r--r--puppet/modules/site_couchdb/manifests/backup.pp4
-rw-r--r--puppet/modules/site_couchdb/manifests/bigcouch.pp50
-rw-r--r--puppet/modules/site_couchdb/manifests/bigcouch/add_nodes.pp8
-rw-r--r--puppet/modules/site_couchdb/manifests/bigcouch/compaction.pp8
-rw-r--r--puppet/modules/site_couchdb/manifests/bigcouch/settle_cluster.pp11
-rw-r--r--puppet/modules/site_couchdb/manifests/create_dbs.pp3
-rw-r--r--puppet/modules/site_couchdb/manifests/init.pp11
-rw-r--r--puppet/modules/site_couchdb/manifests/logrotate.pp14
-rw-r--r--puppet/modules/site_couchdb/manifests/plain.pp2
-rw-r--r--puppet/modules/site_couchdb/manifests/setup.pp18
11 files changed, 14 insertions, 118 deletions
diff --git a/puppet/modules/site_couchdb/manifests/add_users.pp b/puppet/modules/site_couchdb/manifests/add_users.pp
index c905316b..f12c5a5e 100644
--- a/puppet/modules/site_couchdb/manifests/add_users.pp
+++ b/puppet/modules/site_couchdb/manifests/add_users.pp
@@ -33,7 +33,8 @@ class site_couchdb::add_users {
roles => '["tokens"]',
pw => $site_couchdb::couchdb_soledad_pw,
salt => $site_couchdb::couchdb_soledad_salt,
- require => Couchdb::Query::Setup['localhost']
+ require => Couchdb::Query::Setup['localhost'],
+ notify => Service['soledad-server'];
}
## webapp couchdb user
diff --git a/puppet/modules/site_couchdb/manifests/backup.pp b/puppet/modules/site_couchdb/manifests/backup.pp
index 8b5aa6ea..a9771776 100644
--- a/puppet/modules/site_couchdb/manifests/backup.pp
+++ b/puppet/modules/site_couchdb/manifests/backup.pp
@@ -1,8 +1,8 @@
class site_couchdb::backup {
# general backupninja config
- backupninja::config { 'backupninja_config':
- usecolors => false,
+ class { 'backupninja':
+ usecolors => false
}
# dump all DBs locally to /var/backups/couchdb once a day
diff --git a/puppet/modules/site_couchdb/manifests/bigcouch.pp b/puppet/modules/site_couchdb/manifests/bigcouch.pp
deleted file mode 100644
index 2de3d4d0..00000000
--- a/puppet/modules/site_couchdb/manifests/bigcouch.pp
+++ /dev/null
@@ -1,50 +0,0 @@
-# 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']
- -> Service['shorewall']
- -> 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
-
-}
diff --git a/puppet/modules/site_couchdb/manifests/bigcouch/add_nodes.pp b/puppet/modules/site_couchdb/manifests/bigcouch/add_nodes.pp
deleted file mode 100644
index c8c43275..00000000
--- a/puppet/modules/site_couchdb/manifests/bigcouch/add_nodes.pp
+++ /dev/null
@@ -1,8 +0,0 @@
-class site_couchdb::bigcouch::add_nodes {
- # loop through neighbors array and add nodes
- $nodes = $::site_couchdb::bigcouch::config['neighbors']
-
- couchdb::bigcouch::add_node { $nodes:
- require => Couchdb::Query::Setup['localhost']
- }
-}
diff --git a/puppet/modules/site_couchdb/manifests/bigcouch/compaction.pp b/puppet/modules/site_couchdb/manifests/bigcouch/compaction.pp
deleted file mode 100644
index 84aab4ef..00000000
--- a/puppet/modules/site_couchdb/manifests/bigcouch/compaction.pp
+++ /dev/null
@@ -1,8 +0,0 @@
-class site_couchdb::bigcouch::compaction {
- cron {
- 'compact_all_shards':
- command => '/srv/leap/couchdb/scripts/bigcouch_compact_all_shards.sh >> /var/log/bigcouch/compaction.log',
- hour => 3,
- minute => 17;
- }
-}
diff --git a/puppet/modules/site_couchdb/manifests/bigcouch/settle_cluster.pp b/puppet/modules/site_couchdb/manifests/bigcouch/settle_cluster.pp
deleted file mode 100644
index 820b5be2..00000000
--- a/puppet/modules/site_couchdb/manifests/bigcouch/settle_cluster.pp
+++ /dev/null
@@ -1,11 +0,0 @@
-class site_couchdb::bigcouch::settle_cluster {
-
- exec { 'wait_for_couch_nodes':
- command => '/srv/leap/bin/run_tests --test CouchDB/Are_configured_nodes_online? --retry 12 --wait 10'
- }
-
- exec { 'settle_cluster_membership':
- command => '/srv/leap/bin/run_tests --test CouchDB/Is_cluster_membership_ok? --retry 12 --wait 10',
- require => Exec['wait_for_couch_nodes']
- }
-}
diff --git a/puppet/modules/site_couchdb/manifests/create_dbs.pp b/puppet/modules/site_couchdb/manifests/create_dbs.pp
index a2d1c655..ddfb7d65 100644
--- a/puppet/modules/site_couchdb/manifests/create_dbs.pp
+++ b/puppet/modules/site_couchdb/manifests/create_dbs.pp
@@ -44,7 +44,8 @@ class site_couchdb::create_dbs {
## r/w: soledad
couchdb::create_db { 'shared':
members => "{ \"names\": [\"${site_couchdb::couchdb_soledad_user}\"], \"roles\": [\"replication\"] }",
- require => Couchdb::Query::Setup['localhost']
+ require => Couchdb::Query::Setup['localhost'],
+ notify => Service['soledad-server'];
}
## tickets database
diff --git a/puppet/modules/site_couchdb/manifests/init.pp b/puppet/modules/site_couchdb/manifests/init.pp
index c4fe6277..5a73ae87 100644
--- a/puppet/modules/site_couchdb/manifests/init.pp
+++ b/puppet/modules/site_couchdb/manifests/init.pp
@@ -1,4 +1,4 @@
-# entry class for configuring couchdb/bigcouch node
+# entry class for configuring couchdb node
# couchdb node
class site_couchdb {
tag 'leap_service'
@@ -39,16 +39,10 @@ class site_couchdb {
$couchdb_backup = $couchdb_config['backup']
$couchdb_mode = $couchdb_config['mode']
- # ensure bigcouch has been purged from the system:
- # TODO: remove this check in 0.9 release
- if file('/opt/bigcouch/bin/bigcouch', '/dev/null') != '' {
- fail 'ERROR: BigCouch appears to be installed. Make sure you have migrated to CouchDB before proceeding. See https://leap.se/upgrade-0-8'
- }
-
include site_couchdb::plain
Class['site_config::default']
- -> Service['shorewall']
+ -> Exec['shorewall_check']
-> Exec['refresh_stunnel']
-> Class['couchdb']
-> Class['site_couchdb::setup']
@@ -60,7 +54,6 @@ class site_couchdb {
include site_couchdb::create_dbs
include site_couchdb::add_users
include site_couchdb::designs
- include site_couchdb::logrotate
if $couchdb_backup { include site_couchdb::backup }
diff --git a/puppet/modules/site_couchdb/manifests/logrotate.pp b/puppet/modules/site_couchdb/manifests/logrotate.pp
deleted file mode 100644
index bb8843bb..00000000
--- a/puppet/modules/site_couchdb/manifests/logrotate.pp
+++ /dev/null
@@ -1,14 +0,0 @@
-# configure couchdb logrotation
-class site_couchdb::logrotate {
-
- augeas {
- 'logrotate_bigcouch':
- context => '/files/etc/logrotate.d/bigcouch/rule',
- changes => [
- 'set file /opt/bigcouch/var/log/*.log', 'set rotate 7',
- 'set schedule daily', 'set compress compress',
- 'set missingok missingok', 'set ifempty notifempty',
- 'set copytruncate copytruncate' ]
- }
-
-}
diff --git a/puppet/modules/site_couchdb/manifests/plain.pp b/puppet/modules/site_couchdb/manifests/plain.pp
index b40fc100..710ff7ca 100644
--- a/puppet/modules/site_couchdb/manifests/plain.pp
+++ b/puppet/modules/site_couchdb/manifests/plain.pp
@@ -6,8 +6,6 @@ class site_couchdb::plain {
chttpd_bind_address => '127.0.0.1'
}
- include site_check_mk::agent::couchdb::plain
-
# remove bigcouch leftovers from previous installations
include ::site_config::remove::bigcouch
diff --git a/puppet/modules/site_couchdb/manifests/setup.pp b/puppet/modules/site_couchdb/manifests/setup.pp
index 710d3c1c..a749c628 100644
--- a/puppet/modules/site_couchdb/manifests/setup.pp
+++ b/puppet/modules/site_couchdb/manifests/setup.pp
@@ -3,13 +3,6 @@
#
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
- }
-
$user = $site_couchdb::couchdb_admin_user
# setup /etc/couchdb/couchdb-admin.netrc for couchdb admin access
@@ -24,11 +17,11 @@ class site_couchdb::setup {
# (i.e. using curl/wget without passing credentials)
file {
'/etc/couchdb/couchdb.netrc':
- ensure => link,
- target => "/etc/couchdb/couchdb-${user}.netrc";
+ ensure => link,
+ target => "/etc/couchdb/couchdb-${user}.netrc";
'/root/.netrc':
- ensure => link,
- target => '/etc/couchdb/couchdb.netrc';
+ ensure => link,
+ target => '/etc/couchdb/couchdb.netrc';
}
# setup /etc/couchdb/couchdb-soledad-admin.netrc file for couchdb admin
@@ -40,7 +33,8 @@ class site_couchdb::setup {
mode => '0400',
owner => 'soledad-admin',
group => 'root',
- require => [ Package['couchdb'], User['soledad-admin'] ];
+ require => [ Package['couchdb'], User['soledad-admin'] ],
+ notify => Service['soledad-server'];
}
}