Jcrespo has submitted this change and it was merged.

Change subject: Quote ARGS parameters for trusty compatibility
......................................................................


Quote ARGS parameters for trusty compatibility

1) This works on jessie too
2) I prefer to always overwrite the content of the file, as
   setting defaults will maintain the old content
3) We could do it on the role if this could have side effects, but
   I prefer it like this.

Bug: T126757
Change-Id: Iae58e4130dcd27746aae6c112226c56b588bb23f
---
M modules/prometheus/manifests/mysqld_exporter.pp
M modules/role/manifests/prometheus/mysqld_exporter.pp
2 files changed, 10 insertions(+), 20 deletions(-)

Approvals:
  Jcrespo: Looks good to me, approved
  Filippo Giunchedi: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/modules/prometheus/manifests/mysqld_exporter.pp 
b/modules/prometheus/manifests/mysqld_exporter.pp
index 2e4ce5b..3e1c72a 100644
--- a/modules/prometheus/manifests/mysqld_exporter.pp
+++ b/modules/prometheus/manifests/mysqld_exporter.pp
@@ -47,15 +47,13 @@
         notify  => Service['prometheus-mysqld-exporter'],
     }
 
-    if $arguments != '' {
-        file { '/etc/default/prometheus-mysqld-exporter':
-            ensure  => present,
-            mode    => '0444',
-            owner   => 'root',
-            group   => 'root',
-            content => "ARGS=${arguments}",
-            notify  => Service['prometheus-mysqld-exporter'],
-        }
+    file { '/etc/default/prometheus-mysqld-exporter':
+        ensure  => present,
+        mode    => '0444',
+        owner   => 'root',
+        group   => 'root',
+        content => "ARGS=\"${arguments}\"",
+        notify  => Service['prometheus-mysqld-exporter'],
     }
 
     service { 'prometheus-mysqld-exporter':
diff --git a/modules/role/manifests/prometheus/mysqld_exporter.pp 
b/modules/role/manifests/prometheus/mysqld_exporter.pp
index 7a84750..7a819e9 100644
--- a/modules/role/manifests/prometheus/mysqld_exporter.pp
+++ b/modules/role/manifests/prometheus/mysqld_exporter.pp
@@ -1,27 +1,19 @@
 class role::prometheus::mysqld_exporter {
     include passwords::prometheus
 
-    if os_version('debian >= jessie') {
+    prometheus::mysqld_exporter { 'default':
+        client_password => $passwords::prometheus::db_pass,
         # TODO: collect also TokuDB metrics, but only from
         # selected nodes
         # TODO: collect table stats, but less frequently,
         # and avoid s3/dbstore/labsdb hosts
-
-        $arguments = "-collect.global_status \
+        arguments       => "-collect.global_status \
 -collect.global_variables \
 -collect.info_schema.processlist \
 -collect.info_schema.processlist.min_time 0 \
 -collect.slave_status \
 -collect.info_schema.tables false \
 "
-    }
-    else {
-        $arguments = ''
-    }
-
-    prometheus::mysqld_exporter { 'default':
-        client_password => $passwords::prometheus::db_pass,
-        arguments       => $arguments,
     }
 
     $prometheus_nodes = hiera('prometheus_nodes')

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Iae58e4130dcd27746aae6c112226c56b588bb23f
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Jcrespo <[email protected]>
Gerrit-Reviewer: Filippo Giunchedi <[email protected]>
Gerrit-Reviewer: Jcrespo <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to