summaryrefslogtreecommitdiff
path: root/puppet/modules
diff options
context:
space:
mode:
authorMicah <micah@riseup.net>2015-10-13 14:05:48 +0000
committerMicah <micah@riseup.net>2015-10-13 14:05:48 +0000
commit6f04006dc44d52a36fff4d61275c41a6f1f9d59a (patch)
treec721eab63eef1467f5977cb94898d05bf50b9496 /puppet/modules
parentd6b521372243b79105a1513d4559572dfab6db54 (diff)
parent19e5d23e3fe34199265117e033acfabc3cff9109 (diff)
Merge branch '7514_remove_tapicero_couchdb_user' into 'develop'
7514 remove tapicero couchdb user - Resolves: #7514 this depends on this couchdb m.r.: https://gitlab.com/leap/couchdb/merge_requests/2 See merge request !78
Diffstat (limited to 'puppet/modules')
-rw-r--r--puppet/modules/site_config/manifests/remove.pp1
-rw-r--r--puppet/modules/site_config/manifests/remove/monitoring.pp10
-rw-r--r--puppet/modules/site_config/manifests/remove/tapicero.pp24
-rw-r--r--puppet/modules/site_couchdb/manifests/init.pp3
-rw-r--r--puppet/modules/site_nagios/manifests/init.pp4
5 files changed, 35 insertions, 7 deletions
diff --git a/puppet/modules/site_config/manifests/remove.pp b/puppet/modules/site_config/manifests/remove.pp
index 00502c0a..b1ad1a2b 100644
--- a/puppet/modules/site_config/manifests/remove.pp
+++ b/puppet/modules/site_config/manifests/remove.pp
@@ -1,5 +1,4 @@
# remove leftovers from previous deploys
class site_config::remove {
include site_config::remove::files
- include site_config::remove::tapicero
}
diff --git a/puppet/modules/site_config/manifests/remove/monitoring.pp b/puppet/modules/site_config/manifests/remove/monitoring.pp
new file mode 100644
index 00000000..d7095597
--- /dev/null
+++ b/puppet/modules/site_config/manifests/remove/monitoring.pp
@@ -0,0 +1,10 @@
+# remove leftovers on monitoring nodes
+class site_config::remove::monitoring {
+
+ tidy {
+ 'checkmk_logwatch_spool':
+ path => '/var/lib/check_mk/logwatch',
+ recurse => true,
+ matches => '*tapicero.log'
+ }
+}
diff --git a/puppet/modules/site_config/manifests/remove/tapicero.pp b/puppet/modules/site_config/manifests/remove/tapicero.pp
index edb4e393..4ce972d0 100644
--- a/puppet/modules/site_config/manifests/remove/tapicero.pp
+++ b/puppet/modules/site_config/manifests/remove/tapicero.pp
@@ -1,6 +1,23 @@
-# remove tapicero leftovers from previous deploys
+# remove tapicero leftovers from previous deploys on couchdb nodes
class site_config::remove::tapicero {
+ # remove tapicero couchdb user
+ $couchdb_config = hiera('couch')
+ $couchdb_mode = $couchdb_config['mode']
+
+ if $couchdb_mode == 'multimaster'
+ {
+ $port = 5986
+ } else {
+ $port = 5984
+ }
+
+ exec { 'remove_couchdb_user':
+ onlyif => "/usr/bin/curl -s 127.0.0.1:${port}/_users/org.couchdb.user:tapicero | grep -qv 'not_found'",
+ command => "/usr/local/bin/couch-doc-update --host 127.0.0.1:${port} --db _users --id org.couchdb.user:tapicero --delete"
+ }
+
+
exec { 'kill_tapicero':
onlyif => '/usr/bin/test -s /var/run/tapicero.pid',
command => '/usr/bin/pkill --pidfile /var/run/tapicero.pid'
@@ -33,11 +50,6 @@ class site_config::remove::tapicero {
matches => 'tapicero*',
require => [ Exec['kill_tapicero'] ];
'/etc/check_mk/logwatch.d/tapicero.cfg':;
- 'checkmk_logwatch_spool':
- path => '/var/lib/check_mk/logwatch',
- recurse => true,
- matches => '*tapicero.log',
- require => Exec['kill_tapicero'],
}
# remove local nagios plugin checks via mrpe
diff --git a/puppet/modules/site_couchdb/manifests/init.pp b/puppet/modules/site_couchdb/manifests/init.pp
index 1ec15f00..61aa887e 100644
--- a/puppet/modules/site_couchdb/manifests/init.pp
+++ b/puppet/modules/site_couchdb/manifests/init.pp
@@ -62,4 +62,7 @@ class site_couchdb {
include site_check_mk::agent::couchdb
+ # remove tapicero leftovers on couchdb nodes
+ include site_config::remove::tapicero
+
}
diff --git a/puppet/modules/site_nagios/manifests/init.pp b/puppet/modules/site_nagios/manifests/init.pp
index eb08cdcb..40ae4b86 100644
--- a/puppet/modules/site_nagios/manifests/init.pp
+++ b/puppet/modules/site_nagios/manifests/init.pp
@@ -1,6 +1,10 @@
+# setup nagios on monitoring node
class site_nagios {
tag 'leap_service'
Class['site_config::default'] -> Class['site_nagios']
include site_nagios::server
+
+ # remove leftovers on monitoring nodes
+ include site_config::remove::monitoring
}