Puppet Class: db2_install::fact_caching
- Defined in:
- manifests/fact_caching.pp
Summary
This class ensure's that the db2_install facts that can be cached and are cached with the correct settings.Overview
db2_install::fact_caching
You can change all TTL settings for the facts if an other setting is more fitting for your setup.
See the file “LICENSE” for the full license governing this code.
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
# File 'manifests/fact_caching.pp', line 23
class db2_install::fact_caching (
Boolean $enabled,
Optional[String[1]] $installed_components_ttl,
Optional[String[1]] $product_version_ttl
) {
if $enabled {
include db2_install::clear_caches
#
# If enabled, we need to enable the force-dot-resolution
# setting for facter.
#
unless defined(Fact_setting['force-dot-resolution']) {
fact_setting { 'force-dot-resolution':
value => true,
}
}
fact_config { 'db2_install_locations.product_version':
ttl => $product_version_ttl,
}
fact_config { 'db2_install_locations.installed_components':
ttl => $installed_components_ttl,
}
} else {
#
# On puppet versions older than V6, the required libs
# for fact_config are not installed. Because it also doesn't
# serve any purpose, we skip this part on those versions.
#
if versioncmp($clientversion, '6.0.0') != -1 {
#
# Disable fact caching for all db2_install facts
#
$db2_install_facts = [
'db2_install_locations.product_version',
'db2_install_locations.installed_components',
]
fact_config { $db2_install_facts:
ttl => absent,
}
}
}
}
|