From da2c743faaccd26604c4c26fbb1557934688eb4a Mon Sep 17 00:00:00 2001 From: elijah Date: Mon, 1 Feb 2016 15:56:41 -0800 Subject: default to plain couchdb, unless otherwise specified. # Conflicts: # puppet/modules/site_couchdb/manifests/plain.pp --- CHANGES.md | 34 ++++++++++--- provider_base/services/_couchdb_master.json | 8 ---- provider_base/services/_couchdb_mirror.json | 1 + provider_base/services/_couchdb_plain.json | 8 ++++ provider_base/services/couchdb.json | 2 +- provider_base/services/couchdb.rb | 56 +++------------------- .../manifests/agent/couchdb/master.pp | 23 --------- .../site_check_mk/manifests/agent/couchdb/plain.pp | 23 +++++++++ puppet/modules/site_couchdb/manifests/init.pp | 4 +- puppet/modules/site_couchdb/manifests/master.pp | 15 ------ puppet/modules/site_couchdb/manifests/plain.pp | 15 ++++++ 11 files changed, 84 insertions(+), 105 deletions(-) delete mode 100644 provider_base/services/_couchdb_master.json create mode 100644 provider_base/services/_couchdb_plain.json delete mode 100644 puppet/modules/site_check_mk/manifests/agent/couchdb/master.pp create mode 100644 puppet/modules/site_check_mk/manifests/agent/couchdb/plain.pp delete mode 100644 puppet/modules/site_couchdb/manifests/master.pp create mode 100644 puppet/modules/site_couchdb/manifests/plain.pp diff --git a/CHANGES.md b/CHANGES.md index 1d639f45..09bd516e 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,24 +1,46 @@ Platform 0.8 ------------------------ +-------------------------------------- -This release focuses on many improvements to email service. +This release focused on the email service. Additionally, almost all the code +for leap_cli has been moved to leap_platform. * It is possible to require invite codes for new users signing up. -* Admins can now suspect/enable users and block/enable their ability to send - and receive email. + +* Tapicero has been removed. Now user storage databases are created as needed + by soledad, and deleted eventually when no longer needed. + * Bigcouch is now officially deprecated. New nodes created with `leap node add services:couchdb` will default to using plain CouchDB. + It is highly recommended that you run a single couchdb node. + + +* Admins can now suspect/enable users and block/enable their ability to send + and receive email. + * Support for SPF and DKIM. Compatibility: -* Tapicero has been removed. Now, soledad and couchdb must be on the same node. +* Now, soledad and couchdb must be on the same node. * Requires Debian Jessie. Wheezy is no longer supported. +* Requires leap_cli version 1.8 +* Requires bitmask client version >= 0.9 * Includes: + * leap_mx 0.8 * webapp 0.8 + * soledad 0.8 + +Commits: https://leap.se/git/leap_platform.git/shortlog/refs/tags/0.8 +Issues fixed: https://leap.se/code/versions/189 + +Upgrading: + +* To migrate data to use plain couchdb, see + https://leap.se/en/docs/platform/services/couchdb#use-plain-couchdb-instead-of-bigcouch + This is still optional, but is a good idea. Platform 0.7.1 ------------------------ +-------------------------------------- Compatibility: diff --git a/provider_base/services/_couchdb_master.json b/provider_base/services/_couchdb_master.json deleted file mode 100644 index 20c6f99b..00000000 --- a/provider_base/services/_couchdb_master.json +++ /dev/null @@ -1,8 +0,0 @@ -// -// Applied to master couchdb node when there is a single master -// -{ - "couch": { - "mode": "master" - } -} \ No newline at end of file diff --git a/provider_base/services/_couchdb_mirror.json b/provider_base/services/_couchdb_mirror.json index 6a3402bd..da496bae 100644 --- a/provider_base/services/_couchdb_mirror.json +++ b/provider_base/services/_couchdb_mirror.json @@ -1,5 +1,6 @@ // // Applied to all non-master couchdb nodes +// NOT CURRENTLY SUPPORTED // { "stunnel": { diff --git a/provider_base/services/_couchdb_plain.json b/provider_base/services/_couchdb_plain.json new file mode 100644 index 00000000..04380042 --- /dev/null +++ b/provider_base/services/_couchdb_plain.json @@ -0,0 +1,8 @@ +// +// Applied to couchdb node when there is a single plain couchdb +// +{ + "couch": { + "mode": "plain" + } +} \ No newline at end of file diff --git a/provider_base/services/couchdb.json b/provider_base/services/couchdb.json index 5e65b2ec..30cb53d1 100644 --- a/provider_base/services/couchdb.json +++ b/provider_base/services/couchdb.json @@ -8,8 +8,8 @@ } }, "couch": { - "master": false, "port": 5984, + "mode": "plain", "users": { "admin": { "username": "admin", diff --git a/provider_base/services/couchdb.rb b/provider_base/services/couchdb.rb index 3bee3a67..124c1b6c 100644 --- a/provider_base/services/couchdb.rb +++ b/provider_base/services/couchdb.rb @@ -1,60 +1,16 @@ -####################################################################### -### -### NOTE! -### -### Currently, mirrors do not work! The only thing that works is all -### nodes multimaster or a single master. -### -####################################################################### # # custom logic for couchdb json resolution # ============================================ # -# There are three modes for a node: -# -# Multimaster -# ----------- -# -# Multimaster uses bigcouch (soon to use couchdb in replication mode -# similar to bigcouch). -# -# Use "multimaster" mode when: -# -# * multiple nodes are marked couch.master -# * OR no nodes are marked couch.master -# -# Master -# ------ -# -# Master uses plain couchdb that is readable and writable. -# -# Use "master" mode when: -# -# * Exactly one node, this one, is marked as master. -# -# Mirror -# ------ -# -# Mirror creates a read-only copy of the database. It uses plain coucdhb -# with legacy couchdb replication (http based). -# -# This does not currently work, because http replication can't handle -# the number of user databases. -# -# Use "mirror" mode when: -# -# * some nodes are marked couch.master -# * AND this node is not a master +# bigcouch is no longer maintained, so now the default behavior is +# to always use plain couchdb, unless there are more than one couchdb +# node or if "couch.mode" property is set to "multimaster". # -master_count = nodes_like_me['services' => 'couchdb']['couch.master' => true].size +couchdb_nodes = nodes_like_me['services' => 'couchdb'] -if master_count == 0 - apply_partial 'services/_couchdb_multimaster.json' -elsif couch.master && master_count > 1 +if couchdb_nodes.size > 1 || self['couch']['mode'] == "multimaster" apply_partial 'services/_couchdb_multimaster.json' -elsif couch.master && master_count == 1 - apply_partial 'services/_couchdb_master.json' else - apply_partial 'services/_couchdb_mirror.json' + apply_partial 'services/_couchdb_plain.json' end diff --git a/puppet/modules/site_check_mk/manifests/agent/couchdb/master.pp b/puppet/modules/site_check_mk/manifests/agent/couchdb/master.pp deleted file mode 100644 index 291b87d1..00000000 --- a/puppet/modules/site_check_mk/manifests/agent/couchdb/master.pp +++ /dev/null @@ -1,23 +0,0 @@ -# configure logwatch and nagios checks for plain single couchdb master -class site_check_mk::agent::couchdb::master { - - # remove bigcouch leftovers - augeas { - 'Bigcouch_epmd_procs': - incl => '/etc/check_mk/mrpe.cfg', - lens => 'Spacevars.lns', - changes => 'rm /files/etc/check_mk/mrpe.cfg/Bigcouch_epmd_procs', - require => File['/etc/check_mk/mrpe.cfg']; - 'Bigcouch_beam_procs': - incl => '/etc/check_mk/mrpe.cfg', - lens => 'Spacevars.lns', - changes => 'rm /files/etc/check_mk/mrpe.cfg/Bigcouch_beam_procs', - require => File['/etc/check_mk/mrpe.cfg']; - 'Bigcouch_open_files': - incl => '/etc/check_mk/mrpe.cfg', - lens => 'Spacevars.lns', - changes => 'rm /files/etc/check_mk/mrpe.cfg/Bigcouch_open_files', - require => File['/etc/check_mk/mrpe.cfg']; - } - -} diff --git a/puppet/modules/site_check_mk/manifests/agent/couchdb/plain.pp b/puppet/modules/site_check_mk/manifests/agent/couchdb/plain.pp new file mode 100644 index 00000000..3ec2267b --- /dev/null +++ b/puppet/modules/site_check_mk/manifests/agent/couchdb/plain.pp @@ -0,0 +1,23 @@ +# configure logwatch and nagios checks for plain single couchdb master +class site_check_mk::agent::couchdb::plain { + + # remove bigcouch leftovers + augeas { + 'Bigcouch_epmd_procs': + incl => '/etc/check_mk/mrpe.cfg', + lens => 'Spacevars.lns', + changes => 'rm /files/etc/check_mk/mrpe.cfg/Bigcouch_epmd_procs', + require => File['/etc/check_mk/mrpe.cfg']; + 'Bigcouch_beam_procs': + incl => '/etc/check_mk/mrpe.cfg', + lens => 'Spacevars.lns', + changes => 'rm /files/etc/check_mk/mrpe.cfg/Bigcouch_beam_procs', + require => File['/etc/check_mk/mrpe.cfg']; + 'Bigcouch_open_files': + incl => '/etc/check_mk/mrpe.cfg', + lens => 'Spacevars.lns', + changes => 'rm /files/etc/check_mk/mrpe.cfg/Bigcouch_open_files', + require => File['/etc/check_mk/mrpe.cfg']; + } + +} diff --git a/puppet/modules/site_couchdb/manifests/init.pp b/puppet/modules/site_couchdb/manifests/init.pp index 8d79ae75..0c126f0c 100644 --- a/puppet/modules/site_couchdb/manifests/init.pp +++ b/puppet/modules/site_couchdb/manifests/init.pp @@ -41,8 +41,8 @@ class site_couchdb { $couchdb_pwhash_alg = $couchdb_config['pwhash_alg'] if $couchdb_mode == 'multimaster' { include site_couchdb::bigcouch } - if $couchdb_mode == 'master' { include site_couchdb::master } - if $couchdb_mode == 'mirror' { include site_couchdb::mirror } + if $couchdb_mode == 'plain' { include site_couchdb::plain } + # if $couchdb_mode == 'mirror' { include site_couchdb::mirror } Class['site_config::default'] -> Service['shorewall'] diff --git a/puppet/modules/site_couchdb/manifests/master.pp b/puppet/modules/site_couchdb/manifests/master.pp deleted file mode 100644 index 49d90f2f..00000000 --- a/puppet/modules/site_couchdb/manifests/master.pp +++ /dev/null @@ -1,15 +0,0 @@ -# this class sets up a single, plain couchdb node -class site_couchdb::master { - class { 'couchdb': - admin_pw => $site_couchdb::couchdb_admin_pw, - admin_salt => $site_couchdb::couchdb_admin_salt, - chttpd_bind_address => '127.0.0.1', - pwhash_alg => $site_couchdb::couchdb_pwhash_alg - } - - include site_check_mk::agent::couchdb::master - - # remove bigcouch leftovers from previous installations - include ::site_config::remove::bigcouch - -} diff --git a/puppet/modules/site_couchdb/manifests/plain.pp b/puppet/modules/site_couchdb/manifests/plain.pp new file mode 100644 index 00000000..64209142 --- /dev/null +++ b/puppet/modules/site_couchdb/manifests/plain.pp @@ -0,0 +1,15 @@ +# this class sets up a single, plain couchdb node +class site_couchdb::plain { + class { 'couchdb': + admin_pw => $site_couchdb::couchdb_admin_pw, + admin_salt => $site_couchdb::couchdb_admin_salt, + chttpd_bind_address => '127.0.0.1', + pwhash_alg => $site_couchdb::couchdb_pwhash_alg + } + + include site_check_mk::agent::couchdb::plain + + # remove bigcouch leftovers from previous installations + include ::site_config::remove::bigcouch + +} -- cgit v1.2.3