|
22 | 22 | # ['puppet_ssldir'] - Puppet sll directory
|
23 | 23 | # ['puppet_docroot'] - Doc root to be configured in apache vhost
|
24 | 24 | # ['puppet_vardir'] - Vardir used by puppet
|
25 |
| -# ['puppet_passenger_port'] - Port to configure passenger on default 8140 |
| 25 | +# ['puppet_proxy_port'] - Port to configure the proxy on - default 8140 |
| 26 | +# ['puppet_conf'] - Path to the puppet main/agent/master config |
26 | 27 | # ['puppet_master_package'] - Puppet master package
|
27 | 28 | # ['puppet_master_service'] - Puppet master service
|
28 | 29 | # ['version'] - Version of the puppet master package to install
|
|
37 | 38 | # ['always_cache_features'] - if false (default), always try to load a feature even if a previous load failed
|
38 | 39 | # ['serialization_format'] - defaults to undef, otherwise it sets the preferred_serialization_format param (currently only msgpack is supported)
|
39 | 40 | # ['serialization_package'] - defaults to undef, if provided, we install this package, otherwise we fall back to the gem from 'serialization_format'
|
| 41 | +# ['webserver'] - install 'nginx' (with unicorn) or 'httpd' (with passenger) - httpd is default |
| 42 | +# ['listen_address'] - IP for binding the webserver, defaults to * |
| 43 | +# ['disable_ssl'] - Disables SSL on the webserver. usefull if you use this master behind a loadbalancer. currently only supported by nginx, defaults to undef |
| 44 | +# ['backup_upstream'] - specify another puppet master as fallback. currently only supported by nginx |
| 45 | +# ['unicorn_package'] - package name of a unicorn rpm. if provided we install it, otherwise we built it via gem/gcc |
| 46 | +# ['unicorn_path'] - custom path to the unicorn binary |
| 47 | +# ['disable_master'] - this disables the normal master, the server will only act as a CA, currently only supported by nginx |
| 48 | +# ['upstream'] - define additional masters reachable via tcp as an array, currently only supported by nginx |
| 49 | +# ['backend_process_number'] - number of processes to start on the backebd webserver (unicorn/passenger), currently only supported by unicorn |
40 | 50 | #
|
41 | 51 | # Requires:
|
42 | 52 | #
|
|
77 | 87 | $puppet_ssldir = $::puppet::params::puppet_ssldir,
|
78 | 88 | $puppet_docroot = $::puppet::params::puppet_docroot,
|
79 | 89 | $puppet_vardir = $::puppet::params::puppet_vardir,
|
80 |
| - $puppet_passenger_port = $::puppet::params::puppet_passenger_port, |
| 90 | + $puppet_proxy_port = $::puppet::params::puppet_proxy_port, |
81 | 91 | $puppet_passenger_tempdir = false,
|
82 | 92 | $puppet_passenger_cfg_addon = '',
|
83 | 93 | $puppet_master_package = $::puppet::params::puppet_master_package,
|
|
99 | 109 | $passenger_max_requests = 10000,
|
100 | 110 | $passenger_stat_throttle_rate = 30,
|
101 | 111 | $serialization_format = undef,
|
102 |
| - $serialization_package = undef, |
| 112 | + $serialization_package = undef, |
| 113 | + $webserver = $::puppet::params::default_webserver, |
| 114 | + $listen_address = $::puppet::params::listen_address, |
| 115 | + $disable_ssl = $::puppet::params::disable_ssl, |
| 116 | + $backup_upstream = $::puppet::params::backup_upstream, |
| 117 | + $unicorn_path = $::puppet::params::unicorn_path, |
| 118 | + $unicorn_package = $::puppet::params::unicorn_package, |
| 119 | + $disable_master = $::puppet::params::disable_master, |
| 120 | + $upstream = $::puppet::params::upstream, |
| 121 | + $backend_process_number = $::puppet::params::backend_process_number, |
| 122 | + |
103 | 123 | ) inherits puppet::params {
|
104 | 124 |
|
105 | 125 | anchor { 'puppet::master::begin': }
|
|
135 | 155 | ensure => $version,
|
136 | 156 | }
|
137 | 157 | }
|
| 158 | + case $webserver { |
| 159 | + nginx: { |
| 160 | + Anchor['puppet::master::begin'] -> |
| 161 | + class {'puppet::unicorn': |
| 162 | + certname => $certname, |
| 163 | + puppet_conf => $puppet_conf, |
| 164 | + puppet_ssldir => $puppet_ssldir, |
| 165 | + dns_alt_names => $dns_alt_names, |
| 166 | + listen_address => $listen_address, |
| 167 | + puppet_proxy_port => $puppet_proxy_port, |
| 168 | + disable_ssl => $disable_ssl, |
| 169 | + backup_upstream => $backup_upstream, |
| 170 | + unicorn_package => $unicorn_package, |
| 171 | + unicorn_path => $unicorn_path, |
| 172 | + disable_master => $disable_master, |
| 173 | + upstream => $upstream, |
| 174 | + backend_process_number => $backend_process_number, |
| 175 | + } -> |
| 176 | + Anchor['puppet::master::end'] |
| 177 | + } |
| 178 | + default: { |
| 179 | + Anchor['puppet::master::begin'] -> |
| 180 | + class {'puppet::passenger': |
| 181 | + puppet_proxy_port => $puppet_proxy_port, |
| 182 | + puppet_docroot => $puppet_docroot, |
| 183 | + apache_serveradmin => $apache_serveradmin, |
| 184 | + puppet_conf => $::puppet::params::puppet_conf, |
| 185 | + puppet_ssldir => $puppet_ssldir, |
| 186 | + certname => $certname, |
| 187 | + conf_dir => $::puppet::params::confdir, |
| 188 | + dns_alt_names => join($dns_alt_names,','), |
| 189 | + generate_ssl_certs => $generate_ssl_certs, |
| 190 | + puppet_passenger_tempdir => $puppet_passenger_tempdir, |
| 191 | + config_addon => $puppet_passenger_cfg_addon, |
| 192 | + passenger_max_pool_size => $passenger_max_pool_size, |
| 193 | + passenger_high_performance => $passenger_high_performance, |
| 194 | + passenger_max_requests => $passenger_max_requests, |
| 195 | + passenger_stat_throttle_rate => $passenger_stat_throttle_rate, |
138 | 196 |
|
139 |
| - Anchor['puppet::master::begin'] -> |
140 |
| - class {'puppet::passenger': |
141 |
| - puppet_passenger_port => $puppet_passenger_port, |
142 |
| - puppet_docroot => $puppet_docroot, |
143 |
| - apache_serveradmin => $apache_serveradmin, |
144 |
| - puppet_conf => $::puppet::params::puppet_conf, |
145 |
| - puppet_ssldir => $puppet_ssldir, |
146 |
| - certname => $certname, |
147 |
| - conf_dir => $::puppet::params::confdir, |
148 |
| - dns_alt_names => join($dns_alt_names,','), |
149 |
| - generate_ssl_certs => $generate_ssl_certs, |
150 |
| - puppet_passenger_tempdir => $puppet_passenger_tempdir, |
151 |
| - config_addon => $puppet_passenger_cfg_addon, |
152 |
| - passenger_max_pool_size => $passenger_max_pool_size, |
153 |
| - passenger_high_performance => $passenger_high_performance, |
154 |
| - passenger_max_requests => $passenger_max_requests, |
155 |
| - passenger_stat_throttle_rate => $passenger_stat_throttle_rate, |
156 |
| - |
157 |
| - } -> |
158 |
| - Anchor['puppet::master::end'] |
159 |
| - |
| 197 | + } -> |
| 198 | + Anchor['puppet::master::end'] |
| 199 | + } |
| 200 | + } |
160 | 201 | service { $puppet_master_service:
|
161 | 202 | ensure => stopped,
|
162 | 203 | enable => false,
|
|
170 | 211 | require => File[$::puppet::params::confdir],
|
171 | 212 | owner => $::puppet::params::puppet_user,
|
172 | 213 | group => $::puppet::params::puppet_group,
|
173 |
| - notify => Service['httpd'], |
| 214 | + notify => Service[$webserver], |
174 | 215 | }
|
175 | 216 | }
|
176 | 217 | else {
|
177 | 218 | File<| title == $::puppet::params::puppet_conf |> {
|
178 |
| - notify => Service['httpd'], |
| 219 | + notify => Service[$webserver], |
179 | 220 | }
|
180 | 221 | }
|
181 | 222 |
|
|
186 | 227 | require => Package[$puppet_master_package],
|
187 | 228 | owner => $::puppet::params::puppet_user,
|
188 | 229 | group => $::puppet::params::puppet_group,
|
189 |
| - notify => Service['httpd'], |
| 230 | + notify => Service[$webserver], |
190 | 231 | }
|
191 | 232 | }
|
192 | 233 | else {
|
193 | 234 | File<| title == $::puppet::params::confdir |> {
|
194 |
| - notify +> Service['httpd'], |
| 235 | + notify +> Service[$webserver], |
195 | 236 | require +> Package[$puppet_master_package],
|
196 | 237 | }
|
197 | 238 | }
|
|
200 | 241 | ensure => directory,
|
201 | 242 | owner => $::puppet::params::puppet_user,
|
202 | 243 | group => $::puppet::params::puppet_group,
|
203 |
| - notify => Service['httpd'], |
| 244 | + notify => Service[$webserver], |
204 | 245 | require => Package[$puppet_master_package]
|
205 | 246 | }
|
206 | 247 |
|
|
209 | 250 | class { 'puppet::storeconfigs':
|
210 | 251 | dbserver => $storeconfigs_dbserver,
|
211 | 252 | dbport => $storeconfigs_dbport,
|
212 |
| - puppet_service => Service['httpd'], |
| 253 | + puppet_service => Service[$webserver], |
213 | 254 | puppet_confdir => $::puppet::params::confdir,
|
214 | 255 | puppet_conf => $::puppet::params::puppet_conf,
|
215 | 256 | puppet_master_package => $puppet_master_package,
|
|
223 | 264 | Ini_setting {
|
224 | 265 | path => $::puppet::params::puppet_conf,
|
225 | 266 | require => File[$::puppet::params::puppet_conf],
|
226 |
| - notify => Service['httpd'], |
| 267 | + notify => Service[$webserver], |
227 | 268 | section => 'master',
|
228 | 269 | }
|
229 | 270 |
|
|
332 | 373 | setting => 'digest_algorithm',
|
333 | 374 | value => $digest_algorithm,
|
334 | 375 | }
|
335 |
| - |
336 |
| - if $strict_variables != undef { |
337 |
| - validate_bool(str2bool($strict_variables)) |
338 |
| - ini_setting {'puppetmasterstrictvariables': |
339 |
| - ensure => present, |
340 |
| - setting => 'strict_variables', |
341 |
| - value => $strict_variables, |
342 |
| - } |
343 |
| - } |
344 |
| - validate_bool(str2bool($always_cache_features)) |
345 |
| - ini_setting { 'puppetmasteralwayscachefeatures': |
346 |
| - ensure => present, |
347 |
| - setting => 'always_cache_features', |
348 |
| - value => $always_cache_features, |
349 |
| - } |
350 | 376 | if $serialization_format != undef {
|
351 | 377 | if $serialization_package != undef {
|
352 | 378 | package { $serialization_package:
|
|
356 | 382 | if $serialization_format == 'msgpack' {
|
357 | 383 | unless defined(Package[$::puppet::params::ruby_dev]) {
|
358 | 384 | package {$::puppet::params::ruby_dev:
|
359 |
| - ensure => 'latest', |
| 385 | + ensure => latest, |
360 | 386 | }
|
361 | 387 | }
|
362 | 388 | unless defined(Package['gcc']) {
|
363 | 389 | package {'gcc':
|
364 |
| - ensure => 'latest', |
| 390 | + ensure => latest, |
365 | 391 | }
|
366 | 392 | }
|
367 | 393 | unless defined(Package['msgpack']) {
|
368 | 394 | package {'msgpack':
|
369 |
| - ensure => 'latest', |
370 |
| - provider => 'gem', |
| 395 | + ensure => latest, |
| 396 | + provider => gem, |
371 | 397 | require => Package[$::puppet::params::ruby_dev, 'gcc'],
|
372 | 398 | }
|
373 | 399 | }
|
|
378 | 404 | value => $serialization_format,
|
379 | 405 | }
|
380 | 406 | }
|
| 407 | + if $strict_variables != undef { |
| 408 | + validate_bool(str2bool($strict_variables)) |
| 409 | + ini_setting {'puppetmasterstrictvariables': |
| 410 | + ensure => present, |
| 411 | + setting => 'strict_variables', |
| 412 | + value => $strict_variables, |
| 413 | + } |
| 414 | + } |
| 415 | + validate_bool(str2bool($always_cache_features)) |
| 416 | + ini_setting { 'puppetmasteralwayscachefeatures': |
| 417 | + ensure => present, |
| 418 | + setting => 'always_cache_features', |
| 419 | + value => $always_cache_features, |
| 420 | + } |
381 | 421 | anchor { 'puppet::master::end': }
|
382 | 422 | }
|
0 commit comments