LEFT | RIGHT |
(no file at all) | |
| 1 # == Class: adblockplus::buildmaster |
| 2 # |
| 3 # An authoritative build-server setup based on Buildbot and Nginx. |
| 4 # |
| 5 # === Parameters: |
| 6 # |
| 7 # [*domain*] |
| 8 # The domain name associated with the Buildbot waterfall page. |
| 9 # |
| 10 # [*is_default_domain*] |
| 11 # Whether the Buildbot page should serve as the default content |
| 12 # handler with the HTTP server setup. |
| 13 # |
| 14 # [*buildbot_config*] |
| 15 # Translates directly into the $buildbot::master::config option. |
| 16 # |
| 17 # [*ssl_cert*] |
| 18 # The SSL certificate file name within the private module, if any. |
| 19 # Requires an $ssl_key to be provided as well. |
| 20 # |
| 21 # [*ssl_key*] |
| 22 # The SSL key file name within the private module, if any. |
| 23 # Requires an $ssl_cert to be provided as well. |
| 24 # |
| 25 # [*slaves*] |
| 26 # Local buildbot::slave records to setup with the master. |
| 27 # |
| 28 # [*slave_credentials*] |
| 29 # Name => password pairs of e.g. remote build slaves. |
| 30 # |
| 31 # === Examples: |
| 32 # |
| 33 # class {'adblockplus::buildmaster': |
| 34 # domain => 'localhost', |
| 35 # is_default_domain => true, |
| 36 # } |
| 37 # |
| 38 class adblockplus::buildmaster ( |
| 39 $domain, |
| 40 $is_default_domain = false, |
| 41 $buildbot_config = {}, |
| 42 $ssl_cert = hiera('adblockplus::buildmaster::ssl_cert', 'undef'), |
| 43 $ssl_key = hiera('adblockplus::buildmaster::ssl_key', 'undef'), |
| 44 $slaves = hiera('adblockplus::buildmaster::slaves', {}), |
| 45 $slave_credentials = hiera('adblockplus::buildmaster::slave_credentials', {}), |
| 46 ) { |
| 47 |
| 48 include nginx |
| 49 |
| 50 # change default behavior, but still recognize hiera values |
| 51 class {'buildbot': |
| 52 master_service => hiera('buildbot::master_service', 'running'), |
| 53 slave_service => hiera('buildbot::slave_service', 'running'), |
| 54 } |
| 55 |
| 56 # Computable $buildbot::master::config parameters |
| 57 $default_scheme = $ssl_cert ? {/^(undef|)$/ => 'http', default => 'https'} |
| 58 $default_config = { |
| 59 'buildbotURL' => sprintf('%s://%s/', $default_scheme, $domain), |
| 60 } |
| 61 |
| 62 buildbot::master {'default': |
| 63 config => merge($default_config, $buildbot_config), |
| 64 slaves => $slaves, |
| 65 slave_credentials => $slave_credentials, |
| 66 system => true, |
| 67 } |
| 68 |
| 69 buildbot::fragment {'custom': |
| 70 authority => Buildbot::Master['default'], |
| 71 content => template('adblockplus/buildmaster.erb'), |
| 72 } |
| 73 |
| 74 nginx::hostconfig {$domain: |
| 75 certificate => $ssl_cert ? { |
| 76 'undef' => undef, |
| 77 default => $ssl_cert, |
| 78 }, |
| 79 source => 'puppet:///modules/adblockplus/nginx/buildmaster.conf', |
| 80 is_default => $is_default_domain, |
| 81 log => 'access_log_buildbot', |
| 82 private_key => $ssl_key ? { |
| 83 'undef' => undef, |
| 84 default => $ssl_key, |
| 85 }, |
| 86 } |
| 87 } |
LEFT | RIGHT |