Dzahn has submitted this change and it was merged.

Change subject: contint: stop jenkins on contint1001
......................................................................


contint: stop jenkins on contint1001

We dont want Puppet to bring up Jenkins automagically on contint1001
when we are setting it up.

Add parameters to the jenkins class so we can change the
Service['jenkins'] 'ensure' and 'enable' independently on gallium and
contint1001.

Puppet should stop/start jenkins on contint1001 for now. That is
achievable by passing ensure => undef, but the class has a default
value. Introduce a custom 'unmanaged' state which is recognized to pass
undef to the service.

Change-Id: I265a6ef2c62e51c84fab81e69a6caa1089785491
---
M hieradata/hosts/contint1001.yaml
M modules/jenkins/manifests/init.pp
2 files changed, 29 insertions(+), 3 deletions(-)

Approvals:
  Dzahn: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/hieradata/hosts/contint1001.yaml b/hieradata/hosts/contint1001.yaml
index b3b343b..ddfd725 100644
--- a/hieradata/hosts/contint1001.yaml
+++ b/hieradata/hosts/contint1001.yaml
@@ -6,3 +6,6 @@
 ssh::server::explicit_macs: false
 cluster: misc
 contactgroups: 'admins,contint'
+
+jenkins::service_ensure: unmanaged
+jenkins::service_enable: false
diff --git a/modules/jenkins/manifests/init.pp 
b/modules/jenkins/manifests/init.pp
index 9669681..bc1ae44 100644
--- a/modules/jenkins/manifests/init.pp
+++ b/modules/jenkins/manifests/init.pp
@@ -1,4 +1,23 @@
-class jenkins {
+# == Class jenkins
+#
+# Set up a basic Jenkins master instance for CI.
+#
+# == Parameters:
+#
+# [*service_ensure*]
+#
+# Passed to Puppet Service['jenkins']. If set to 'unmanaged', pass undef to
+# prevent Puppet from managing the service. Default: 'running'.
+#
+# [*service_enable*]
+#
+# Passed to Puppet Service['jenkins'] as 'enable'. Default: true.
+#
+class jenkins(
+    $service_ensure  = 'running',
+    $service_enable = true,
+)
+{
     require jenkins::user
     require jenkins::group
 
@@ -43,9 +62,13 @@
         ensure => absent,
     }
 
+    $real_ensure = $service_ensure ? {
+        'unmanaged' => undef,
+        default     => $service_ensure,
+    }
     service { 'jenkins':
-        ensure     => 'running',
-        enable     => true,
+        ensure     => $real_ensure,
+        enable     => $service_enable,
         hasrestart => true,
         # Better have umask properly set before starting
         require    => File['/var/lib/jenkins/.daemonrc'],

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I265a6ef2c62e51c84fab81e69a6caa1089785491
Gerrit-PatchSet: 4
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Hashar <has...@free.fr>
Gerrit-Reviewer: Alexandros Kosiaris <akosia...@wikimedia.org>
Gerrit-Reviewer: Chad <ch...@wikimedia.org>
Gerrit-Reviewer: Dzahn <dz...@wikimedia.org>
Gerrit-Reviewer: Giuseppe Lavagetto <glavage...@wikimedia.org>
Gerrit-Reviewer: Hashar <has...@free.fr>
Gerrit-Reviewer: Thcipriani <tcipri...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to