Alexandros Kosiaris has submitted this change and it was merged.
Change subject: zuul: phase out zuulwikimedia
......................................................................
zuul: phase out zuulwikimedia
Replace realm based roles by ... role based roles! This introduces:
role::zuul::merger
role::zuul::server
That makes zuulwikimedia::instance useless. The previous roles
(labs/production) are kept around for backward compatibility.
Change-Id: Ib05cdd7dda96b29f34086b8fe071f89726d19110
---
M manifests/role/zuul.pp
M manifests/site.pp
D manifests/zuul.pp
3 files changed, 77 insertions(+), 118 deletions(-)
Approvals:
Alexandros Kosiaris: Verified; Looks good to me, approved
diff --git a/manifests/role/zuul.pp b/manifests/role/zuul.pp
index ec69ef0..ab1bf99 100644
--- a/manifests/role/zuul.pp
+++ b/manifests/role/zuul.pp
@@ -64,30 +64,76 @@
} # /role::zuul::configuration
-# == Class: role::zuul::labs
+# == Class role::zuul::install
#
-# Install the Zuul gating system suitable for the Continuous Integration labs
-# instance. This role can not really be reused on a different instance since it
-# hardcodes several parameters such as the Gerrit IP or the URL hostnames.
-class role::zuul::labs {
- system::role { 'role::zuul::labs': description => 'Zuul on labs!' }
+# Wrapper around ::zuul class which is needed by both merger and server roles
+# that can in turn be installed on the same node. Prevent a duplication error.
+#
+class role::zuul::install {
- include contint::proxy_zuul,
- role::zuul::configuration
+ include role::zuul::configuration
class { '::zuul':
git_source_branch =>
$role::zuul::configuration::shared[$::realm]['git_source_branch'],
}
+} # /role::zuul::install
- # Setup the instance for labs usage
- zuulwikimedia::instance { 'zuul-labs':
- # Server related
- config_git_branch =>
$role::zuul::configuration::server[$::realm]['config_git_branch'],
+class role::zuul::server {
+ system::role { 'role::zuul::server': description => 'Zuul server
(scheduler)' }
+
+ include contint::proxy_zuul
+ include role::zuul::configuration
+ include role::zuul::install
+ include ::zuul::monitoring::server
+
+ # Zuul server needs an API key to interact with Jenkins:
+ require passwords::misc::contint::jenkins
+ $jenkins_apikey = $::passwords::misc::contint::jenkins::zuul_user_apikey
+
+ class { '::zuul::server':
+ # Shared settings
+ gearman_server =>
$role::zuul::configuration::shared[$::realm]['gearman_server'],
+ gerrit_server =>
$role::zuul::configuration::shared[$::realm]['gerrit_server'],
+ gerrit_user =>
$role::zuul::configuration::shared[$::realm]['gerrit_user'],
+ url_pattern =>
$role::zuul::configuration::shared[$::realm]['url_pattern'],
+ status_url =>
$role::zuul::configuration::shared[$::realm]['status_url'],
+
+ # Server settings
gearman_server_start =>
$role::zuul::configuration::server[$::realm]['gearman_server_start'],
+ jenkins_apikey => $jenkins_apikey,
jenkins_server =>
$role::zuul::configuration::server[$::realm]['jenkins_server'],
jenkins_user =>
$role::zuul::configuration::server[$::realm]['jenkins_user'],
statsd_host =>
$role::zuul::configuration::server[$::realm]['statsd_host'],
+ }
+ # Deploy Wikimedia Zuul configuration files.
+ #
+ # Describe the behaviors and jobs
+ # Conf file is hosted in integration/zuul-config git repo
+ git::clone { 'integration/zuul-config':
+ directory => '/etc/zuul/wikimedia',
+ owner => jenkins,
+ group => jenkins,
+ mode => '0775',
+ origin =>
'https://gerrit.wikimedia.org/r/p/integration/zuul-config.git',
+ branch =>
$role::zuul::configuration::server[$::realm]['config_git_branch'],
+ }
+
+} # /role::zuul::server
+
+class role::zuul::merger {
+ system::role { 'role::zuul::merver': description => 'Zuul merger' }
+
+ if $::realm == 'production' {
+ # We will receive replication of git bare repositories from Gerrit
+ include role::gerrit::production::replicationdest
+ }
+
+ include role::zuul::configuration
+ include role::zuul::install
+ include ::zuul::monitoring::merger
+
+ class { '::zuul::merger':
# Shared settings
gearman_server =>
$role::zuul::configuration::shared[$::realm]['gearman_server'],
gerrit_server =>
$role::zuul::configuration::shared[$::realm]['gerrit_server'],
@@ -107,6 +153,22 @@
zuul_git_dir =>
$role::zuul::configuration::merger[$::realm]['git_dir'],
}
+} # /role::zuul::merger
+
+
+# == Class: role::zuul::labs
+#
+# Install the Zuul gating system suitable for the Continuous Integration labs
+# instance. This role can not really be reused on a different instance since it
+# hardcodes several parameters such as the Gerrit IP or the URL hostnames.
+#
+# For back compatibility purposes
+class role::zuul::labs {
+ system::role { 'role::zuul::labs (obsolete)': description => 'Zuul on
labs!' }
+
+ include role::zuul::merger
+ include role::zuul::server
+
} # /role::zuul::labs
# Class: role::zuul::production
@@ -120,42 +182,9 @@
# Zuul when a change is submitted.
#
class role::zuul::production {
- system::role { 'role::zuul::production': description => 'Zuul on
production' }
+ system::role { 'role::zuul::production (obsolete)': description => 'Zuul
on production' }
- # We will receive replication of git bare repositories from Gerrit
- include role::gerrit::production::replicationdest
- include contint::proxy_zuul
-
- class { '::zuul':
- git_source_branch =>
$role::zuul::configuration::shared[$::realm]['git_source_branch'],
- }
-
- # TODO: should require Mount['/srv/ssd']
- zuulwikimedia::instance { 'zuul-production':
- # Server related
- config_git_branch =>
$role::zuul::configuration::server[$::realm]['config_git_branch'],
- gearman_server_start =>
$role::zuul::configuration::server[$::realm]['gearman_server_start'],
- jenkins_server =>
$role::zuul::configuration::server[$::realm]['jenkins_server'],
- jenkins_user =>
$role::zuul::configuration::server[$::realm]['jenkins_user'],
- statsd_host =>
$role::zuul::configuration::server[$::realm]['statsd_host'],
-
- # Shared settings
- gearman_server =>
$role::zuul::configuration::shared[$::realm]['gearman_server'],
- gerrit_server =>
$role::zuul::configuration::shared[$::realm]['gerrit_server'],
- gerrit_user =>
$role::zuul::configuration::shared[$::realm]['gerrit_user'],
- url_pattern =>
$role::zuul::configuration::shared[$::realm]['url_pattern'],
- status_url =>
$role::zuul::configuration::shared[$::realm]['status_url'],
-
- # Merger related
- git_dir =>
$role::zuul::configuration::merger[$::realm]['git_dir'],
- git_email =>
$role::zuul::configuration::merger[$::realm]['git_email'],
- git_name =>
$role::zuul::configuration::merger[$::realm]['git_name'],
- zuul_url =>
$role::zuul::configuration::merger[$::realm]['zuul_url'],
- }
-
- # Serves Zuul git repositories on git://zuul.eqiad.wmnet/...
- class { 'contint::zuul::git-daemon':
- zuul_git_dir =>
$role::zuul::configuration::merger[$::realm]['git_dir'],
- }
+ include role::zuul::merger
+ include role::zuul::server
} # /role::zuul::production
diff --git a/manifests/site.pp b/manifests/site.pp
index 645f202..e223199 100644
--- a/manifests/site.pp
+++ b/manifests/site.pp
@@ -22,7 +22,6 @@
import 'sudo.pp'
import 'swift.pp'
import 'webserver.pp'
-import 'zuul.pp'
# Include stages last
import 'stages.pp'
diff --git a/manifests/zuul.pp b/manifests/zuul.pp
deleted file mode 100644
index 2068a73..0000000
--- a/manifests/zuul.pp
+++ /dev/null
@@ -1,69 +0,0 @@
-# manifests/zuul.pp
-
-class zuulwikimedia {
-
- # Deploy wikimedia Zuul configuration files
- # Parameters are passed to the files templates
- define instance(
- $jenkins_server,
- $jenkins_user,
- $gearman_server,
- $gearman_server_start,
- $gerrit_server,
- $gerrit_user,
- $url_pattern,
- $status_url,
- $zuul_url,
- $config_git_branch='master',
- $git_dir='/var/lib/zuul/git',
- $statsd_host = '',
- $git_email = "zuul-merger@${::hostname}",
- $git_name = 'Wikimedia Zuul Merger'
- ) {
-
- # Zuul server needs an API key to interact with Jenkins:
- require passwords::misc::contint::jenkins
- $jenkins_apikey =
$::passwords::misc::contint::jenkins::zuul_user_apikey
-
- class { '::zuul::server':
- statsd_host => $statsd_host,
- gerrit_server => $gerrit_server,
- gerrit_user => $gerrit_user,
- jenkins_server => $jenkins_server,
- jenkins_user => $jenkins_user,
- jenkins_apikey => $jenkins_apikey,
- gearman_server => $gearman_server,
- gearman_server_start => $gearman_server_start,
- url_pattern => $url_pattern,
- status_url => $status_url,
- }
- include ::zuul::monitoring::server
-
- class { '::zuul::merger':
- gearman_server => $gearman_server,
- gerrit_server => $gerrit_server,
- gerrit_user => $gerrit_user,
- git_dir => $git_dir,
- git_email => "zuul-merger@${::hostname}",
- git_name => 'Wikimedia Zuul Merger',
- url_pattern => $url_pattern,
- status_url => $status_url,
- zuul_url => $zuul_url,
- }
- include ::zuul::monitoring::merger
-
- # Deploy Wikimedia Zuul configuration files.
- #
- # Describe the behaviors and jobs
- # Conf file is hosted in integration/zuul-config git repo
- git::clone {
- 'integration/zuul-config':
- directory => '/etc/zuul/wikimedia',
- owner => jenkins,
- group => jenkins,
- mode => '0775',
- origin =>
'https://gerrit.wikimedia.org/r/p/integration/zuul-config.git',
- branch => $config_git_branch,
- }
- }
-}
--
To view, visit https://gerrit.wikimedia.org/r/145047
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ib05cdd7dda96b29f34086b8fe071f89726d19110
Gerrit-PatchSet: 10
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: Ottomata <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits