summaryrefslogtreecommitdiff
path: root/puppet/modules/site_couchdb
diff options
context:
space:
mode:
authorAzul <azul@riseup.net>2014-06-19 12:29:30 +0200
committerAzul <azul@riseup.net>2014-06-19 12:29:30 +0200
commitb286f81dd29404b64494dab3fe1e7a2bec1c9c46 (patch)
tree8d3dfafca4afd17692783ecb942f683fc8b68876 /puppet/modules/site_couchdb
parent90a97f5333e82e302f487b060076a8c0ceaf6259 (diff)
separate bigcouch specifics from init.pp
Diffstat (limited to 'puppet/modules/site_couchdb')
-rw-r--r--puppet/modules/site_couchdb/manifests/bigcouch.pp20
-rw-r--r--puppet/modules/site_couchdb/manifests/init.pp21
2 files changed, 24 insertions, 17 deletions
diff --git a/puppet/modules/site_couchdb/manifests/bigcouch.pp b/puppet/modules/site_couchdb/manifests/bigcouch.pp
new file mode 100644
index 00000000..a3f6db2c
--- /dev/null
+++ b/puppet/modules/site_couchdb/manifests/bigcouch.pp
@@ -0,0 +1,20 @@
+class site_couchdb::bigcouch {
+
+ $bigcouch_config = $couchdb_config['bigcouch']
+ $bigcouch_cookie = $bigcouch_config['cookie']
+
+ $ednp_port = $bigcouch_config['ednp_port']
+
+ Class['site_config::default']
+ -> Class['site_couchdb::bigcouch::add_nodes']
+ -> Class['site_couchdb::bigcouch::settle_cluster']
+
+ include site_couchdb::bigcouch::add_nodes
+ include site_couchdb::bigcouch::settle_cluster
+ include site_couchdb::bigcouch::compaction
+ include site_shorewall::couchdb::bigcouch
+
+ file { '/var/log/bigcouch':
+ ensure => directory
+ }
+}
diff --git a/puppet/modules/site_couchdb/manifests/init.pp b/puppet/modules/site_couchdb/manifests/init.pp
index 3614661d..22d6ef45 100644
--- a/puppet/modules/site_couchdb/manifests/init.pp
+++ b/puppet/modules/site_couchdb/manifests/init.pp
@@ -35,14 +35,10 @@ class site_couchdb {
$couchdb_webapp_salt = $couchdb_webapp['salt']
$couchdb_backup = $couchdb_config['backup']
-
- $bigcouch_config = $couchdb_config['bigcouch']
- $bigcouch_cookie = $bigcouch_config['cookie']
-
- $ednp_port = $bigcouch_config['ednp_port']
+ $couchdb_bigcouch = $couchdb_config['mode'] == "multimaster"
class { 'couchdb':
- bigcouch => true,
+ bigcouch => $couchdb_bigcouch,
admin_pw => $couchdb_admin_pw,
admin_salt => $couchdb_admin_salt,
bigcouch_cookie => $bigcouch_cookie,
@@ -63,8 +59,6 @@ class site_couchdb {
-> Class['site_couchdb::stunnel']
-> Service['couchdb']
-> File['/root/.netrc']
- -> Class['site_couchdb::bigcouch::add_nodes']
- -> Class['site_couchdb::bigcouch::settle_cluster']
-> Class['site_couchdb::create_dbs']
-> Class['site_couchdb::add_users']
@@ -95,24 +89,17 @@ class site_couchdb {
}
include site_couchdb::stunnel
- include site_couchdb::bigcouch::add_nodes
- include site_couchdb::bigcouch::settle_cluster
include site_couchdb::create_dbs
include site_couchdb::add_users
include site_couchdb::designs
include site_couchdb::logrotate
- include site_couchdb::bigcouch::compaction
- if $couchdb_backup { include site_couchdb::backup }
+ if $couchdb_bigcouch { include site_couchdb::bigcouch }
+ if $couchdb_backup { include site_couchdb::backup }
include site_shorewall::couchdb
- include site_shorewall::couchdb::bigcouch
include site_check_mk::agent::couchdb
include site_check_mk::agent::tapicero
- file { '/var/log/bigcouch':
- ensure => directory
- }
-
}