Ori.livneh has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/144351

Change subject: nutcracker: delete twemproxy module and tie up loose ends
......................................................................

nutcracker: delete twemproxy module and tie up loose ends

This patch contains changes split off from of PS10 of Giuseppe's change 
I42ee37f14:

* Delete the twemproxy module.
* Make the nutcracker check_proc icinga alert expect one and only one running 
process.
* Undeclare /usr/local/bin/restart-twemproxy (to be deleted via salt).
* Unset obsolete sudo privs for wikidev.

Change-Id: Ie1c8106720c1da06a38e91f261fe8e8cdda94cdd
---
M manifests/misc/deployment.pp
M manifests/role/mediawiki.pp
D modules/mediawiki/files/twemproxy.default
M modules/mediawiki/manifests/init.pp
M modules/mediawiki/manifests/users.pp
M modules/nutcracker/manifests/monitoring.pp
D modules/twemproxy/files/default
D modules/twemproxy/files/twemproxy.conf
D modules/twemproxy/manifests/decom.pp
D modules/twemproxy/manifests/init.pp
D modules/twemproxy/manifests/monitoring.pp
11 files changed, 1 insertion(+), 122 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/51/144351/1

diff --git a/manifests/misc/deployment.pp b/manifests/misc/deployment.pp
index 5bfd113..c06d848 100644
--- a/manifests/misc/deployment.pp
+++ b/manifests/misc/deployment.pp
@@ -149,9 +149,6 @@
         '/usr/local/bin/mw-update-l10n':
             ensure => link,
             target => '/srv/deployment/scap/scap/bin/mw-update-l10n';
-        '/usr/local/bin/restart-twemproxy':
-            ensure => link,
-            target => '/srv/deployment/scap/scap/bin/restart-twemproxy';
         '/usr/local/bin/restart-nutcracker':
             ensure => link,
             target => '/srv/deployment/scap/scap/bin/restart-nutcracker';
diff --git a/manifests/role/mediawiki.pp b/manifests/role/mediawiki.pp
index 9488efe..8fa71e3 100644
--- a/manifests/role/mediawiki.pp
+++ b/manifests/role/mediawiki.pp
@@ -8,7 +8,6 @@
     include standard
     include geoip
     include ::mediawiki
-    include ::twemproxy::monitoring
     include ::nutcracker::monitoring
 
     $mediawiki_log_aggregator = 'fluorine.eqiad.wmnet:8420'
diff --git a/modules/mediawiki/files/twemproxy.default 
b/modules/mediawiki/files/twemproxy.default
deleted file mode 100644
index 2aa8166..0000000
--- a/modules/mediawiki/files/twemproxy.default
+++ /dev/null
@@ -1,4 +0,0 @@
-# Configuration file for twemproxy
-MW_COMMON=`bash -c 'source /usr/local/lib/mw-deployment-vars.sh && echo 
$MW_COMMON'`
-. $MW_COMMON/multiversion/MWRealm.sh
-CONFIG=`getRealmSpecificFilename "$MW_COMMON/wmf-config/twemproxy.yaml"`
diff --git a/modules/mediawiki/manifests/init.pp 
b/modules/mediawiki/manifests/init.pp
index 47c28b8..ccf62cc 100644
--- a/modules/mediawiki/manifests/init.pp
+++ b/modules/mediawiki/manifests/init.pp
@@ -11,10 +11,6 @@
         content => $::site,
     }
 
-    class { '::twemproxy':
-        default_file => 'puppet:///modules/mediawiki/twemproxy.default',
-    }
-
     if $::realm == 'labs' {
         $mw_mc_server_list = [
             '10.68.16.14:11211', # deployment-memc02.eqiad.wmflabs
diff --git a/modules/mediawiki/manifests/users.pp 
b/modules/mediawiki/manifests/users.pp
index 14aafbd..b896cde 100644
--- a/modules/mediawiki/manifests/users.pp
+++ b/modules/mediawiki/manifests/users.pp
@@ -77,9 +77,7 @@
     sudo_group { 'wikidev':
         privileges => [
             'ALL = (apache,mwdeploy,l10nupdate) NOPASSWD: ALL',
-            'ALL = (root) NOPASSWD: /sbin/restart twemproxy',
             'ALL = (root) NOPASSWD: /sbin/restart nutcracker',
-            'ALL = (root) NOPASSWD: /sbin/start twemproxy',
             'ALL = (root) NOPASSWD: /sbin/start nutcracker',
             'ALL = NOPASSWD: /usr/sbin/apache2ctl',
             'ALL = NOPASSWD: /etc/init.d/apache2',
diff --git a/modules/nutcracker/manifests/monitoring.pp 
b/modules/nutcracker/manifests/monitoring.pp
index eb52c6d..c73d007 100644
--- a/modules/nutcracker/manifests/monitoring.pp
+++ b/modules/nutcracker/manifests/monitoring.pp
@@ -5,7 +5,7 @@
 class nutcracker::monitoring {
     nrpe::monitor_service { 'nutcracker':
         description  => 'nutcracker process',
-        nrpe_command => '/usr/lib/nagios/plugins/check_procs -c 1:2 -u nobody 
-C nutcracker',
+        nrpe_command => '/usr/lib/nagios/plugins/check_procs -c 1:1 -u nobody 
-C nutcracker',
     }
 
     nrpe::monitor_service { 'nutcracker_port':
diff --git a/modules/twemproxy/files/default b/modules/twemproxy/files/default
deleted file mode 100644
index 029e233..0000000
--- a/modules/twemproxy/files/default
+++ /dev/null
@@ -1,3 +0,0 @@
-# Default file for Twemproxy
-# This file is managed by Puppet
-CONFIG=/etc/twemproxy.yaml
diff --git a/modules/twemproxy/files/twemproxy.conf 
b/modules/twemproxy/files/twemproxy.conf
deleted file mode 100644
index c4d55f5..0000000
--- a/modules/twemproxy/files/twemproxy.conf
+++ /dev/null
@@ -1,23 +0,0 @@
-# Upstart job configuration for twemproxy, a fast and lightweight
-# proxy for the memcached and redis protocols.
-description "memcached and redis proxy"
-
-start on (runlevel [2345] and net-device-up IFACE!=lo)
-stop on runlevel [!2345]
-
-setuid nobody
-
-pre-start script
-  [ ! -r /etc/default/twemproxy ] && { stop; exit 0; }
-  . /etc/default/twemproxy
-  /usr/local/bin/nutcracker --conf-file="$CONFIG" --test-conf || { stop; exit 
0; }
-end script
-
-script
-  . /etc/default/twemproxy
-  /usr/local/bin/nutcracker --mbuf-size=65536 --conf-file="$CONFIG"
-end script
-
-respawn
-
-# vim: set ft=upstart:
diff --git a/modules/twemproxy/manifests/decom.pp 
b/modules/twemproxy/manifests/decom.pp
deleted file mode 100644
index 330ec7e..0000000
--- a/modules/twemproxy/manifests/decom.pp
+++ /dev/null
@@ -1,25 +0,0 @@
-# == Class: twemproxy::decom
-#
-# Decommission twemproxy.
-#
-class twemproxy::decom {
-    service { 'twemproxy':
-        ensure   => stopped,
-        provider => upstart,
-        before   => File['/etc/init/twemproxy.conf'],
-    }
-
-    file { '/etc/init/twemproxy.conf':
-        ensure => absent,
-        before => File['/etc/default/twemproxy'],
-    }
-
-    file { '/etc/default/twemproxy':
-        ensure => absent,
-        before => Package['twemproxy'],
-    }
-
-    package { 'twemproxy':
-        ensure => absent,
-    }
-}
diff --git a/modules/twemproxy/manifests/init.pp 
b/modules/twemproxy/manifests/init.pp
deleted file mode 100644
index 0168249..0000000
--- a/modules/twemproxy/manifests/init.pp
+++ /dev/null
@@ -1,41 +0,0 @@
-# == Class: twemproxy
-#
-# twemproxy (pronounced "two-em-proxy") is a fast and lightweight proxy
-# for memcached and redis. It was primarily built to reduce the
-# connection count on the backend caching servers.
-#
-# === Parameters
-#
-# [*default_file*]
-#   Puppet file URI or local filesystem path to file that should be
-#   used as /etc/default/twemproxy. The file should set a CONFIG var
-#   in the environment that points to the twemproxy YAML config file.
-#   Defaults to 'puppet:///modules/twemproxy/default'.
-#
-# === Examples
-#
-#  class { 'twemproxy':
-#    default_file => 'puppet:///modules/mediawiki/twemproxy.default',
-#  }
-#
-class twemproxy( $default_file = 'puppet:///modules/twemproxy/default' ) {
-    package { 'twemproxy': }
-
-    file { '/etc/init/twemproxy.conf':
-        source => 'puppet:///modules/twemproxy/twemproxy.conf',
-        notify => Service['twemproxy'],
-    }
-
-    file { '/etc/default/twemproxy':
-        source  => $default_file,
-        owner   => 'root',
-        group   => 'root',
-        mode    => '0644',
-        notify  => Service['twemproxy'],
-    }
-
-    service { 'twemproxy':
-        ensure   => running,
-        provider => upstart,
-    }
-}
diff --git a/modules/twemproxy/manifests/monitoring.pp 
b/modules/twemproxy/manifests/monitoring.pp
deleted file mode 100644
index c2baf61..0000000
--- a/modules/twemproxy/manifests/monitoring.pp
+++ /dev/null
@@ -1,15 +0,0 @@
-# == Class: twemproxy::monitoring
-#
-# Provisions Icinga alerts for twemproxy.
-#
-class twemproxy::monitoring {
-    nrpe::monitor_service { 'twemproxy':
-        description  => 'twemproxy process',
-        nrpe_command => '/usr/lib/nagios/plugins/check_procs -c 1:2 -u nobody 
-C nutcracker',
-    }
-
-    nrpe::monitor_service { 'twemproxy_port':
-        description  => 'twemproxy port',
-        nrpe_command => '/usr/lib/nagios/plugins/check_tcp -H 127.0.0.1 -p 
11211 --timeout=2',
-    }
-}

-- 
To view, visit https://gerrit.wikimedia.org/r/144351
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie1c8106720c1da06a38e91f261fe8e8cdda94cdd
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Ori.livneh <o...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to