Skip to content

Commit 9215ce4

Browse files
author
Tim Meusel
committed
add always_cache_features support
this feature is explained here: https://docs.puppetlabs.com/references/latest/configuration.html#alwayscachefeatures default is false, in that case, puppet tries to load a feature on each run, even if the previous run failed to load it. you get a big performance boost if you enable this. than puppet checks it once and caches the result
1 parent 0809e3e commit 9215ce4

File tree

1 file changed

+17
-9
lines changed

1 file changed

+17
-9
lines changed

manifests/master.pp

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
# ['digest_algorithm'] - The algorithm to use for file digests.
3535
# ['generate_ssl_certs'] - Generate ssl certs (false to disable)
3636
# ['strict_variables'] - Makes the parser raise errors when referencing unknown variables
37+
# ['always_cache_features'] - if false (default), always try to load a feature even if a previous load failed
3738
#
3839
# Requires:
3940
#
@@ -89,6 +90,7 @@
8990
$generate_ssl_certs = true,
9091
$strict_variables = undef,
9192
$puppetdb_version = 'present',
93+
$always_cache_features = false,
9294
) inherits puppet::params {
9395

9496
anchor { 'puppet::master::begin': }
@@ -305,25 +307,31 @@
305307
}
306308

307309
ini_setting {'puppetmasterdnsaltnames':
308-
ensure => present,
309-
setting => 'dns_alt_names',
310-
value => join($dns_alt_names, ','),
310+
ensure => present,
311+
setting => 'dns_alt_names',
312+
value => join($dns_alt_names, ','),
311313
}
312314

313315
ini_setting {'puppetmasterdigestalgorithm':
314-
ensure => present,
315-
setting => 'digest_algorithm',
316-
value => $digest_algorithm,
316+
ensure => present,
317+
setting => 'digest_algorithm',
318+
value => $digest_algorithm,
317319
}
318320

319321
if $strict_variables != undef {
320322
validate_bool(str2bool($strict_variables))
321323
ini_setting {'puppetmasterstrictvariables':
322-
ensure => present,
323-
setting => 'strict_variables',
324-
value => $strict_variables,
324+
ensure => present,
325+
setting => 'strict_variables',
326+
value => $strict_variables,
325327
}
326328
}
327329

330+
validate_bool(str2bool($always_cache_features))
331+
ini_setting { 'puppetmasteralwayscachefeatures':
332+
ensure => present,
333+
setting => 'always_cache_features',
334+
value => $always_cache_features,
335+
}
328336
anchor { 'puppet::master::end': }
329337
}

0 commit comments

Comments
 (0)