|
28 | 28 | # ['configtimeout'] - How long the client should wait for the configuration to be retrieved before considering it a failure
|
29 | 29 | # ['stringify_facts'] - Wether puppet transforms structured facts in strings or no. Defaults to true in puppet < 4, deprecated in puppet >=4 (and will default to false)
|
30 | 30 | # ['serialization_format'] - defaults to undef, otherwise it sets the preferred_serialization_format param (currently only msgpack is supported)
|
| 31 | +# ['serialization_package'] - defaults to undef, if provided, we install this package, otherwise we fall back to the gem from 'serialization_format' |
31 | 32 | #
|
32 | 33 | # Actions:
|
33 | 34 | # - Install and configures the puppet agent
|
|
68 | 69 | $configtimeout = '2m',
|
69 | 70 | $stringify_facts = undef,
|
70 | 71 | $serialization_format = undef,
|
| 72 | + $serialization_package = undef, |
71 | 73 | ) inherits puppet::params {
|
72 | 74 |
|
73 | 75 | if ! defined(User[$::puppet::params::puppet_user]) {
|
|
310 | 312 | }
|
311 | 313 | }
|
312 | 314 | if $serialization_format != undef {
|
313 |
| - if $serialization_format == 'msgpack' { |
314 |
| - unless defined(Package[$::puppet::params::ruby_dev]) { |
315 |
| - package {$::puppet::params::ruby_dev: |
316 |
| - ensure => 'latest', |
317 |
| - } |
318 |
| - } -> |
319 |
| - unless defined(Package['gcc']) { |
320 |
| - package {'gcc': |
| 315 | + if $serialization_package != undef { |
| 316 | + package { $serialization_package: |
| 317 | + ensure => latest, |
| 318 | + } |
| 319 | + } else { |
| 320 | + if $serialization_format == 'msgpack' { |
| 321 | + unless defined(Package[$::puppet::params::ruby_dev]) { |
| 322 | + package {$::puppet::params::ruby_dev: |
| 323 | + ensure => 'latest', |
| 324 | + } |
| 325 | + } -> |
| 326 | + unless defined(Package['gcc']) { |
| 327 | + package {'gcc': |
| 328 | + ensure => 'latest', |
| 329 | + } |
| 330 | + } -> |
| 331 | + package {'msgpack': |
321 | 332 | ensure => 'latest',
|
| 333 | + provider => 'gem', |
322 | 334 | }
|
323 |
| - } -> |
324 |
| - package {'msgpack': |
325 |
| - ensure => 'latest', |
326 |
| - provider => 'gem', |
327 | 335 | }
|
328 | 336 | }
|
329 | 337 | ini_setting {'puppetagentserializationformat':
|
330 | 338 | setting => 'preferred_serialization_format',
|
331 |
| - value => $serialization_format |
| 339 | + value => $serialization_format, |
332 | 340 | }
|
333 | 341 | }
|
334 | 342 | }
|
0 commit comments