LEFT | RIGHT |
1 # == Class: buildbot | 1 # == Class: buildbot |
2 # | 2 # |
3 # Manage Buildbot (https://buildbot.net/) master and slave setups. | 3 # Manage Buildbot (https://buildbot.net/) master and slave setups. |
4 # | 4 # |
5 # Class buildbot acts as the root namespace for the buildbot integration | 5 # Class buildbot acts as the root namespace for the buildbot integration |
6 # with Puppet, while also providing a variety of setup parameters that can | 6 # with Puppet, while also providing a variety of setup parameters that can |
7 # be used to adjust the software setup. | 7 # be used to adjust the software setup. |
8 # | 8 # |
9 # It defines a set of virtual resources titled 'buildmaster' and 'buildslave'. | 9 # It defines a set of virtual resources titled 'buildmaster' and 'buildslave'. |
10 # Those are realized implicitly when required by any of the various entities | 10 # Those are realized implicitly when required by any of the various entities |
11 # within the module, but may become realized explicitely when necessary: | 11 # within the module, but may become realized explicitely when necessary: |
12 # | 12 # |
13 # - Concat[]: The 'buildmaster' and 'buildslave' system daemon configuration | 13 # - Concat[]: The 'buildmaster' and 'buildslave' system daemon configuration |
14 # - Concat::Fragment[]: The respective root or configuration head fragment | 14 # - Concat::Fragment[]: The respective root or configuration head fragment |
15 # - File[]: The anchestor of default for master and slave $basedir resources | 15 # - File[]: The anchestor of default for master and slave $basedir resources |
16 # - Service[]: The actual services running the master and slave instances | 16 # - Service[]: The actual services running the master and slave instances |
17 # | 17 # |
18 # Note, however, that the respective instances are rather implementation | 18 # Note, however, that the respective instances are rather implementation |
19 # specific and thus may become subject to change in the future. | 19 # specific and thus may become subject to change in the future. |
20 # | 20 # |
21 # === Parameters: | 21 # === Parameters: |
22 # | 22 # |
23 # [*master_config*] | |
24 # The path to the 'buildmaster' system configuration. | |
25 # | |
26 # [*master_directory*] | |
27 # The anchestor of the default buildbot::master $basedir. | |
28 # | |
29 # [*master_pacakges*] | |
30 # The packages that provide the buildbot::master dependencies. | |
31 # | |
32 # [*master_runner*] | |
33 # The path to the runner used for buildbot::master instances. | |
34 # | |
35 # [*master_service*] | 23 # [*master_service*] |
36 # The status 'buildmaster' service status to ensure, if any. | 24 # The 'buildmaster' service status to ensure, if any. |
37 # | |
38 # [*master_user*] | |
39 # The user operating the 'buildmaster' service. | |
40 # | |
41 # [*slave_config*] | |
42 # The path to the 'buildslave' system configuration. | |
43 # | |
44 # [*slave_directory*] | |
45 # The anchestor of the default buildbot::slave $basedir. | |
46 # | |
47 # [*slave_pacakges*] | |
48 # The packages that provide the buildbot::slave dependencies. | |
49 # | |
50 # [*slave_runner*] | |
51 # The path to the runner used for buildbot::slave instances. | |
52 # | 25 # |
53 # [*slave_service*] | 26 # [*slave_service*] |
54 # The status 'buildslave' service status to ensure, if any. | 27 # The 'buildslave' service status to ensure, if any. |
55 # | |
56 # [*slave_user*] | |
57 # The user operating the 'buildslave' service. | |
58 # | 28 # |
59 # === Examples: | 29 # === Examples: |
60 # | 30 # |
61 # class {'buildbot': | 31 # class {'buildbot': |
62 # master => 'running', | 32 # master_service => 'running', |
63 # } | 33 # } |
64 # | 34 # |
65 class buildbot ( | 35 class buildbot ( |
66 $master_config = '/etc/default/buildmaster', | |
67 $master_directory = '/var/buildmaster', | |
68 $master_packages = ['buildbot'], | |
69 $master_runner = '/usr/bin/buildbot', | |
70 $master_service = undef, | 36 $master_service = undef, |
71 $master_user = 'buildbot', | |
72 $slave_config = '/etc/default/buildslave', | |
73 $slave_directory = '/var/buildslave', | |
74 $slave_packages = ['buildbot-slave'], | |
75 $slave_runner = '/usr/bin/buildslave', | |
76 $slave_service = undef, | 37 $slave_service = undef, |
77 $slave_user = 'buildbot', | |
78 ) { | 38 ) { |
| 39 |
| 40 $master_config = '/etc/default/buildmaster' |
| 41 $master_directory = '/var/buildmaster' |
| 42 $master_packages = ['buildbot'] |
| 43 $master_runner = '/usr/bin/buildbot' |
| 44 $master_user = 'buildbot' |
| 45 |
| 46 $slave_config = '/etc/default/buildslave' |
| 47 $slave_directory = '/var/buildslave' |
| 48 $slave_packages = ['buildbot-slave'] |
| 49 $slave_runner = '/usr/bin/buildslave' |
| 50 $slave_user = 'buildbot' |
79 | 51 |
80 @concat { | 52 @concat { |
81 'buildmaster': | 53 'buildmaster': |
82 owner => $master_user, | 54 owner => $master_user, |
83 path => $master_config, | 55 path => $master_config, |
84 require => Package[$master_packages]; | 56 require => Package[$master_packages]; |
85 'buildslave': | 57 'buildslave': |
86 owner => $slave_user, | 58 owner => $slave_user, |
87 path => $slave_config, | 59 path => $slave_config, |
88 require => Package[$slave_packages]; | 60 require => Package[$slave_packages]; |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 if $master_service != undef { | 114 if $master_service != undef { |
143 ensure_packages($master_packages) | 115 ensure_packages($master_packages) |
144 realize(Service['buildmaster']) | 116 realize(Service['buildmaster']) |
145 } | 117 } |
146 | 118 |
147 if $slave_service != undef { | 119 if $slave_service != undef { |
148 ensure_packages($slave_packages) | 120 ensure_packages($slave_packages) |
149 realize(Service['buildslave']) | 121 realize(Service['buildslave']) |
150 } | 122 } |
151 } | 123 } |
LEFT | RIGHT |