Index: modules/adblockplus/manifests/buildserver.pp |
diff --git a/modules/adblockplus/manifests/buildserver.pp b/modules/adblockplus/manifests/buildserver.pp |
new file mode 100644 |
index 0000000000000000000000000000000000000000..dd77c278aaa5d85047ee68d2174a6fb2b72abaf5 |
--- /dev/null |
+++ b/modules/adblockplus/manifests/buildserver.pp |
@@ -0,0 +1,78 @@ |
+# == Class: adblockplus::buildserver |
+# |
+# An authoritative build-server setup based on Buildbot and Nginx. |
+# |
+# === Parameters: |
+# |
+# [*domain*] |
+# The domain name associated with the Buildbot waterfall page. |
+# |
+# [*is_default_domain*] |
+# Whether the Buildbot page should serve as the default content |
+# handler with the HTTP server setup. |
+# |
+# [*ssl_cert*] |
+# The SSL certificate file name within the private module, if any. |
+# Requires an $ssl_key to be provided as well. |
+# |
+# [*ssl_key*] |
+# The SSL key file name within the private module, if any. |
+# Requires an $ssl_cert to be provided as well. |
+# |
+# [*slaves*] |
+# Local buildbot::slave records to setup with the master. |
+# |
+# [*slots*] |
+# Name => password pairs of e.g. remote build slaves. |
+# |
+# === Examples: |
+# |
+# class {'adblockplus::buildserver': |
+# domain => 'localhost', |
+# is_default_domain => true, |
+# } |
+# |
+class adblockplus::buildserver ( |
+ $domain, |
+ $is_default_domain = false, |
+ $project = {}, |
+ $ssl_cert = hiera('adblockplus::buildserver::ssl_cert', 'undef'), |
+ $ssl_key = hiera('adblockplus::buildserver::ssl_key', 'undef'), |
+ $slaves = hiera('adblockplus::buildserver::slaves', {}), |
+ $slots = hiera('adblockplus::buildserver::slots', {}), |
+) { |
+ |
+ include nginx |
+ |
+ # change default behavior, but still recognize hiera values |
+ class {'buildbot': |
+ master_service => hiera('buildbot::master_service', 'running'), |
+ slave_service => hiera('buildbot::slave_service', 'running'), |
+ } |
+ |
+ buildbot::master {'default': |
+ project => $project, |
+ slaves => $slaves, |
+ slots => $slots, |
+ system => true, |
+ } |
+ |
+ buildbot::fragment {'custom': |
+ authority => Buildbot::Master['default'], |
+ content => template('adblockplus/buildserver.erb'), |
+ } |
+ |
+ nginx::hostconfig {$domain: |
+ certificate => $ssl_cert ? { |
+ 'undef' => undef, |
+ default => $ssl_cert, |
+ }, |
+ source => 'puppet:///modules/adblockplus/nginx/buildserver.conf', |
+ is_default => $is_default_domain, |
+ log => 'access_log_buildbot', |
+ private_key => $ssl_key ? { |
+ 'undef' => undef, |
+ default => $ssl_key, |
+ }, |
+ } |
+} |