Alexandros Kosiaris has submitted this change and it was merged.
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, 35 insertions(+), 5 deletions(-)
Approvals:
Hashar: Verified; Looks good to me, but someone else must approve
Alexandros Kosiaris: Looks good to me, approved
jenkins-bot: Verified
diff --git a/manifests/role/ci.pp b/manifests/role/ci.pp
index 5bbaf96..33c5469 100644
--- a/manifests/role/ci.pp
+++ b/manifests/role/ci.pp
@@ -136,8 +136,12 @@
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',
+ owner => 'jenkins-slave',
+ group => 'jenkins-slave',
+ }
contint::tmpfs { 'tmpfs for jenkins CI slave':
user => 'jenkins-slave',
@@ -213,6 +217,14 @@
mode => '0775',
}
+ # Maven requires a webproxy on labs slaves
+ class { 'contint::maven_webproxy':
+ homedir => '/mnt/home/jenkins-deploy',
+ owner => 'jenkins-deploy',
+ group => 'wikidev',
+ 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..bfb064e 100644
--- a/modules/contint/manifests/maven_webproxy.pp
+++ b/modules/contint/manifests/maven_webproxy.pp
@@ -1,12 +1,30 @@
+# == 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
+#
+# [*owner*]
+# User name owning the .m2 directory
+#
+# [*group*]
+# Group name owning the .m2 directory
+#
+class contint::maven_webproxy( $homedir, $owner, $group ) {
- file { '/var/lib/jenkins-slave/.m2':
+ file { "${homedir}/.m2":
ensure => 'directory',
+ owner => $owner,
+ group => $group,
}
- file { '/var/lib/jenkins-slave/.m2/settings.xml':
+ file { "${homedir}/.m2/settings.xml":
mode => '0444',
+ # Belong to root since we dont want anyone to change the settings
+ owner => 'root',
+ group => 'root',
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: merged
Gerrit-Change-Id: I433366ea51740c9a8256a755e8171fab90fb80ee
Gerrit-PatchSet: 4
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Hashar <[email protected]>
Gerrit-Reviewer: Alexandros Kosiaris <[email protected]>
Gerrit-Reviewer: Hashar <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits