Jcrespo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/367408 )

Change subject: prometheus-mysqld-exporter: Fix dependencies and not auto-start
......................................................................

prometheus-mysqld-exporter: Fix dependencies and not auto-start

Services wants to start before the unit are definied. Also, this
is one if the rare cases in which we want to not auto-start
(service declaration), because we will only start parametrized
services for the unit, and not the unit on its own - if defaults
to true for the service definition.

Bug: T170666
Change-Id: I59a51bcbfe68ce05ac32b09c484f8abc152592ce
---
M modules/prometheus/manifests/mysqld_exporter/common.pp
M modules/prometheus/manifests/mysqld_exporter/instance.pp
2 files changed, 7 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/08/367408/1

diff --git a/modules/prometheus/manifests/mysqld_exporter/common.pp 
b/modules/prometheus/manifests/mysqld_exporter/common.pp
index 3f18340..af295b2 100644
--- a/modules/prometheus/manifests/mysqld_exporter/common.pp
+++ b/modules/prometheus/manifests/mysqld_exporter/common.pp
@@ -14,10 +14,11 @@
     }
 
     base::service_unit { 'prometheus-mysqld-exporter@':
-        ensure        => present,
-        refresh       => true,
-        systemd       => true,
-        template_name => 'prometheus-mysqld-exporter@',
-        require       => Package['prometheus-mysqld-exporter'],
+        ensure          => present,
+        refresh         => true,
+        systemd         => true,
+        template_name   => 'prometheus-mysqld-exporter@',
+        require         => Package['prometheus-mysqld-exporter'],
+        declare_service => False, # it will only be used parametrized
     }
 }
diff --git a/modules/prometheus/manifests/mysqld_exporter/instance.pp 
b/modules/prometheus/manifests/mysqld_exporter/instance.pp
index 52139bf..39ceda4 100644
--- a/modules/prometheus/manifests/mysqld_exporter/instance.pp
+++ b/modules/prometheus/manifests/mysqld_exporter/instance.pp
@@ -56,5 +56,6 @@
 
     service { $service:
         ensure  => running,
+        require => 
File['/lib/systemd/system/prometheus-mysqld-exporter@.service'],
     }
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I59a51bcbfe68ce05ac32b09c484f8abc152592ce
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Jcrespo <jcre...@wikimedia.org>

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

Reply via email to