Springle has submitted this change and it was merged.

Change subject: mysql_wmf - autoload layout and lint fixes
......................................................................


mysql_wmf - autoload layout and lint fixes

move classes into autoload layout
fix lint warnings

Change-Id: Ie7510e8c90e365f43ce621c3f524aa1e87e2c584
---
A modules/mysql_wmf/manifests/client.pp
M modules/mysql_wmf/manifests/conf.pp
A modules/mysql_wmf/manifests/datadirs.pp
M modules/mysql_wmf/manifests/init.pp
M modules/mysql_wmf/manifests/monitor/percona.pp
A modules/mysql_wmf/manifests/mysqlpath.pp
A modules/mysql_wmf/manifests/mysqluser.pp
A modules/mysql_wmf/manifests/pc/conf.pp
A modules/mysql_wmf/manifests/slow_digest.pp
9 files changed, 134 insertions(+), 102 deletions(-)

Approvals:
  Yuvipanda: Looks good to me, but someone else must approve
  Springle: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/modules/mysql_wmf/manifests/client.pp 
b/modules/mysql_wmf/manifests/client.pp
new file mode 100644
index 0000000..5d0bf84
--- /dev/null
+++ b/modules/mysql_wmf/manifests/client.pp
@@ -0,0 +1,14 @@
+# TODO do we want to have a class for PHP clients (php5-mysql) as well
+# and rename this to mysql::client-cli?
+class mysql_wmf::client {
+    if versioncmp($::lsbdistrelease, '12.04') >= 0 {
+        package { 'mysql-client-5.5':
+            ensure => latest,
+        }
+    } else {
+        package { 'mysql-client-5.1':
+            ensure => latest,
+        }
+    }
+}
+
diff --git a/modules/mysql_wmf/manifests/conf.pp 
b/modules/mysql_wmf/manifests/conf.pp
index e1af965..37ef90a 100644
--- a/modules/mysql_wmf/manifests/conf.pp
+++ b/modules/mysql_wmf/manifests/conf.pp
@@ -3,7 +3,7 @@
         'fundraisingdb' => {
             'innodb_log_file_size' => '500M'
         },
-        'm1' => {
+        'm1'            => {
             'innodb_log_file_size' => '500M'
         },
     }
diff --git a/modules/mysql_wmf/manifests/datadirs.pp 
b/modules/mysql_wmf/manifests/datadirs.pp
new file mode 100644
index 0000000..e275d84
--- /dev/null
+++ b/modules/mysql_wmf/manifests/datadirs.pp
@@ -0,0 +1,17 @@
+class mysql_wmf::datadirs {
+    file { '/a/sqldata':
+        ensure  => directory,
+        owner   => 'mysql',
+        group   => 'mysql',
+        mode    => '0755',
+        require => User['mysql'],
+    }
+    file { '/a/tmp':
+        ensure  => directory,
+        owner   => 'mysql',
+        group   => 'mysql',
+        mode    => '0755',
+        require => User['mysql'],
+    }
+}
+
diff --git a/modules/mysql_wmf/manifests/init.pp 
b/modules/mysql_wmf/manifests/init.pp
index 5936ccd..35c3241 100644
--- a/modules/mysql_wmf/manifests/init.pp
+++ b/modules/mysql_wmf/manifests/init.pp
@@ -76,96 +76,3 @@
 
 }
 
-class mysql_wmf::mysqluser {
-    user {
-        'mysql': ensure => 'present',
-    }
-}
-
-class mysql_wmf::datadirs {
-    file { '/a/sqldata':
-        ensure  => directory,
-        owner   => 'mysql',
-        group   => 'mysql',
-        mode    => '0755',
-        require => User['mysql'],
-    }
-    file { '/a/tmp':
-        ensure  => directory,
-        owner   => 'mysql',
-        group   => 'mysql',
-        mode    => '0755',
-        require => User['mysql'],
-    }
-}
-
-class mysql_wmf::pc::conf inherits mysql_wmf {
-    file { '/etc/my.cnf':
-        owner   => 'root',
-        group   => 'root',
-        mode    => '0444',
-        content => template('mysql_wmf/paresercache.my.cnf.erb'),
-    }
-    file { '/etc/mysql/my.cnf':
-        owner  => 'root',
-        group  => 'root',
-        mode   => '0444',
-        source => 'puppet:///modules/mysql_wmf/empty-my.cnf',
-    }
-}
-
-class mysql_wmf::mysqlpath {
-    file { '/etc/profile.d/mysqlpath.sh':
-        owner  => 'root',
-        group  => 'root',
-        mode   => '0444',
-        source => 'puppet:///modules/mysql_wmf/mysqlpath.sh',
-    }
-}
-
-# TODO do we want to have a class for PHP clients (php5-mysql) as well
-# and rename this to mysql::client-cli?
-class mysql_wmf::client {
-    if versioncmp($::lsbdistrelease, '12.04') >= 0 {
-        package { 'mysql-client-5.5':
-            ensure => latest,
-        }
-    } else {
-        package { 'mysql-client-5.1':
-            ensure => latest,
-        }
-    }
-}
-
-class mysql_wmf::slow_digest {
-    include passwords::mysql::querydigest
-    $mysql_user = 'ops'
-    $digest_host = 'm1-master.eqiad.wmnet'
-    $digest_db = 'query_digests'
-
-    file { '/usr/local/bin/send_query_digest.sh':
-        owner   => 'root',
-        group   => 'root',
-        mode    => '0500',
-        content => template('mysql_wmf/send_query_digest.sh.erb'),
-    }
-
-    if $mysql_wmf::db_cluster {
-        cron { 'slow_digest':
-            ensure  => present,
-            command => '/usr/local/bin/send_query_digest.sh >/dev/null 2>&1',
-            require => File['/usr/local/bin/send_query_digest.sh'],
-            user    => root,
-            minute  => '*/20',
-            hour    => '*',
-        }
-        cron { 'tcp_query_digest':
-            ensure  => present,
-            command => '/usr/local/bin/send_query_digest.sh tcpdump >/dev/null 
2>&1',
-            require => File['/usr/local/bin/send_query_digest.sh'],
-            user    => root,
-            minute  => [5, 25, 45],
-            hour    => '*',
-        }
-    }
-}
diff --git a/modules/mysql_wmf/manifests/monitor/percona.pp 
b/modules/mysql_wmf/manifests/monitor/percona.pp
index 4356b48..e516494 100644
--- a/modules/mysql_wmf/manifests/monitor/percona.pp
+++ b/modules/mysql_wmf/manifests/monitor/percona.pp
@@ -7,12 +7,44 @@
         nrpe_command  => '/usr/lib/nagios/plugins/check_procs -c 1:1 -C 
mysqld',
         critical      => $crit,
     }
-    monitor_service { 'mysql recent restart': description => 'MySQL Recent 
Restart', check_command => 'nrpe_check_mysql_recent_restart', critical => $crit 
}
-    monitor_service { 'full lvs snapshot': description => 'Full LVS Snapshot', 
check_command => 'nrpe_check_lvs', critical => false }
-    monitor_service { 'mysql idle transaction': description => 'MySQL Idle 
Transactions', check_command => 'nrpe_check_mysql_idle_transactions', critical 
=> false }
-    monitor_service { 'mysql slave running': description => 'MySQL Slave 
Running', check_command => 'nrpe_check_mysql_slave_running', critical => false }
-    monitor_service { 'mysql replication heartbeat': description => 'MySQL 
Replication Heartbeat', check_command => 'nrpe_check_mysql_slave_heartbeat', 
critical => false }
-    monitor_service { 'mysql slave delay': description => 'MySQL Slave Delay', 
check_command => 'nrpe_check_mysql_slave_delay', critical => false }
-    monitor_service { 'mysql processlist': description => 'MySQL Processlist', 
check_command => 'nrpe_pmp_check_mysql_processlist', critical => false }
-    monitor_service { 'mysql innodb': description => 'MySQL InnoDB', 
check_command => 'nrpe_pmp_check_mysql_innodb', critical => false }
+    monitor_service { 'mysql recent restart':
+        description   => 'MySQL Recent Restart',
+        check_command => 'nrpe_check_mysql_recent_restart',
+        critical      => $crit,
+    }
+    monitor_service { 'full lvs snapshot':
+        description   => 'Full LVS Snapshot',
+        check_command => 'nrpe_check_lvs',
+        critical      => false,
+    }
+    monitor_service { 'mysql idle transaction':
+        description   => 'MySQL Idle Transactions',
+        check_command => 'nrpe_check_mysql_idle_transactions',
+        critical      => false,
+    }
+    monitor_service { 'mysql slave running':
+        description   => 'MySQL Slave Running',
+        check_command => 'nrpe_check_mysql_slave_running',
+        critical      => false,
+    }
+    monitor_service { 'mysql replication heartbeat':
+        description   => 'MySQL Replication Heartbeat',
+        check_command => 'nrpe_check_mysql_slave_heartbeat',
+        critical      => false,
+    }
+    monitor_service { 'mysql slave delay':
+        description   => 'MySQL Slave Delay',
+        check_command => 'nrpe_check_mysql_slave_delay',
+        critical      => false,
+    }
+    monitor_service { 'mysql processlist':
+        description   => 'MySQL Processlist',
+        check_command => 'nrpe_pmp_check_mysql_processlist',
+        critical      => false,
+    }
+    monitor_service { 'mysql innodb':
+        description   => 'MySQL InnoDB',
+        check_command => 'nrpe_pmp_check_mysql_innodb',
+        critical      => false,
+    }
 }
diff --git a/modules/mysql_wmf/manifests/mysqlpath.pp 
b/modules/mysql_wmf/manifests/mysqlpath.pp
new file mode 100644
index 0000000..d4964d8
--- /dev/null
+++ b/modules/mysql_wmf/manifests/mysqlpath.pp
@@ -0,0 +1,9 @@
+class mysql_wmf::mysqlpath {
+    file { '/etc/profile.d/mysqlpath.sh':
+        owner  => 'root',
+        group  => 'root',
+        mode   => '0444',
+        source => 'puppet:///modules/mysql_wmf/mysqlpath.sh',
+    }
+}
+
diff --git a/modules/mysql_wmf/manifests/mysqluser.pp 
b/modules/mysql_wmf/manifests/mysqluser.pp
new file mode 100644
index 0000000..ced7f92
--- /dev/null
+++ b/modules/mysql_wmf/manifests/mysqluser.pp
@@ -0,0 +1,6 @@
+class mysql_wmf::mysqluser {
+    user { 'mysql':
+        ensure => present,
+    }
+}
+
diff --git a/modules/mysql_wmf/manifests/pc/conf.pp 
b/modules/mysql_wmf/manifests/pc/conf.pp
new file mode 100644
index 0000000..5b35d76
--- /dev/null
+++ b/modules/mysql_wmf/manifests/pc/conf.pp
@@ -0,0 +1,15 @@
+class mysql_wmf::pc::conf inherits mysql_wmf {
+    file { '/etc/my.cnf':
+        owner   => 'root',
+        group   => 'root',
+        mode    => '0444',
+        content => template('mysql_wmf/paresercache.my.cnf.erb'),
+    }
+    file { '/etc/mysql/my.cnf':
+        owner  => 'root',
+        group  => 'root',
+        mode   => '0444',
+        source => 'puppet:///modules/mysql_wmf/empty-my.cnf',
+    }
+}
+
diff --git a/modules/mysql_wmf/manifests/slow_digest.pp 
b/modules/mysql_wmf/manifests/slow_digest.pp
new file mode 100644
index 0000000..456c6f8
--- /dev/null
+++ b/modules/mysql_wmf/manifests/slow_digest.pp
@@ -0,0 +1,32 @@
+class mysql_wmf::slow_digest {
+    include passwords::mysql::querydigest
+    $mysql_user = 'ops'
+    $digest_host = 'm1-master.eqiad.wmnet'
+    $digest_db = 'query_digests'
+
+    file { '/usr/local/bin/send_query_digest.sh':
+        owner   => 'root',
+        group   => 'root',
+        mode    => '0500',
+        content => template('mysql_wmf/send_query_digest.sh.erb'),
+    }
+
+    if $mysql_wmf::db_cluster {
+        cron { 'slow_digest':
+            ensure  => present,
+            command => '/usr/local/bin/send_query_digest.sh >/dev/null 2>&1',
+            require => File['/usr/local/bin/send_query_digest.sh'],
+            user    => 'root',
+            minute  => '*/20',
+            hour    => '*',
+        }
+        cron { 'tcp_query_digest':
+            ensure  => present,
+            command => '/usr/local/bin/send_query_digest.sh tcpdump >/dev/null 
2>&1',
+            require => File['/usr/local/bin/send_query_digest.sh'],
+            user    => 'root',
+            minute  => [5, 25, 45],
+            hour    => '*',
+        }
+    }
+}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie7510e8c90e365f43ce621c3f524aa1e87e2c584
Gerrit-PatchSet: 3
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Dzahn <[email protected]>
Gerrit-Reviewer: Dzahn <[email protected]>
Gerrit-Reviewer: John F. Lewis <[email protected]>
Gerrit-Reviewer: Matanya <[email protected]>
Gerrit-Reviewer: Springle <[email protected]>
Gerrit-Reviewer: Yuvipanda <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to