summaryrefslogtreecommitdiff
path: root/puppet/modules/site_config
diff options
context:
space:
mode:
authorelijah <elijah@riseup.net>2015-10-14 12:45:09 -0700
committerelijah <elijah@riseup.net>2015-10-14 12:45:09 -0700
commit81763f22e0e5515fa2a3b9c8a65050692bb1cf74 (patch)
tree42a86bbb40d4a7b8b84c37bae4f0aa3362a3c475 /puppet/modules/site_config
parent33b9876af4af85504107aae20feb57aaab5a17ad (diff)
parent43595b105a21aaccb41c4d9199d87b3dc2d48ab5 (diff)
Merge branch 'develop' of ssh://leap.se/leap_platform into develop
Diffstat (limited to 'puppet/modules/site_config')
-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
3 files changed, 28 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