Hashar has uploaded a new change for review.

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

Change subject: contint: apply maven settings on labs slaves
......................................................................

contint: apply maven settings on labs slaves

The production slaves run with the jenkins-slave user which has a maven
setting to point maven to our web proxy.  The slaves (running jobs with
jenkins-deploy) are missing that configuration which cause issue
whenever maven attempt to access URLs hosted in labs (such as
toolslabs.wmflabs.org).

Add a required 'homedir' parameter to contint::maven_webproxy. Set it
accordingly for prod and slave labs.

Change-Id: I433366ea51740c9a8256a755e8171fab90fb80ee
---
M manifests/role/ci.pp
M modules/contint/manifests/maven_webproxy.pp
2 files changed, 20 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/22/124822/1

diff --git a/manifests/role/ci.pp b/manifests/role/ci.pp
index 5bbaf96..4a401ae 100644
--- a/manifests/role/ci.pp
+++ b/manifests/role/ci.pp
@@ -136,8 +136,10 @@
         require => User['jenkins-slave'],
     }
 
-    # Maven require a webproxy on production slaves
-    include contint::maven_webproxy
+    # Maven requires a webproxy on production slaves
+    class { 'contint::maven_webproxy':
+        homedir => '/var/lib/jenkins-slave',
+    }
 
     contint::tmpfs { 'tmpfs for jenkins CI slave':
         user        => 'jenkins-slave',
@@ -213,6 +215,12 @@
         mode   => '0775',
     }
 
+    # Maven requires a webproxy on production slaves
+    class { 'contint::maven_webproxy':
+        homedir => '/mnt/home/jenkins-deploy',
+        require => File['/mnt/home/jenkins-deploy'],
+    }
+
     file { '/mnt/home/jenkins-deploy/.pip':
         ensure => directory,
         owner  => 'jenkins-deploy',
diff --git a/modules/contint/manifests/maven_webproxy.pp 
b/modules/contint/manifests/maven_webproxy.pp
index f1ed31b..6fe2db9 100644
--- a/modules/contint/manifests/maven_webproxy.pp
+++ b/modules/contint/manifests/maven_webproxy.pp
@@ -1,11 +1,18 @@
+# == Class contint::maven_webproxy
+#
 # Maintains maven settings for the jenkins-slave user
-class contint::maven_webproxy {
+#
+# == Parameters:
+#
+# [*homedir*] Base path where to write the maven configuration file
+#
+class contint::maven_webproxy( $homedir ) {
 
-  file { '/var/lib/jenkins-slave/.m2':
+  file { "${homedir}/.m2":
     ensure => 'directory',
   }
 
-  file { '/var/lib/jenkins-slave/.m2/settings.xml':
+  file { "${homedir}/.m2/settings.xml":
     mode    => '0444',
     content => template('contint/maven-webproxy.xml.erb'),
   }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I433366ea51740c9a8256a755e8171fab90fb80ee
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Hashar <[email protected]>

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

Reply via email to