Puppet Class: ora_install::fact_caching
- Defined in:
- manifests/fact_caching.pp
Summary
This class ensure's that the ora_install facts that can be cached and are cached with the correct settings.Overview
ora_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.
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 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 |
# File 'manifests/fact_caching.pp', line 38
class ora_install::fact_caching (
Optional[String[1]] $defined_sids_ttl,
Boolean $enabled,
Optional[String[1]] $installed_patches_ttl,
Optional[String[1]] $opatch_version_ttl,
Optional[String[1]] $ora_install_inventory_loc_ttl,
Optional[String[1]] $product_version_ttl,
Optional[String[1]] $running_processes_ttl,
) {
if $enabled {
include ora_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 { 'ora_install_homes.product_version':
ttl => $product_version_ttl,
}
fact_config { 'ora_install_homes.opatch_version':
ttl => $opatch_version_ttl,
}
fact_config { 'ora_install_homes.installed_patches':
ttl => $installed_patches_ttl,
}
fact_config { 'ora_install_homes.running_processes':
ttl => $running_processes_ttl,
}
fact_config { 'ora_install_homes.defined_sids':
ttl => $defined_sids_ttl,
}
fact_config { 'ora_install_inventory_loc':
ttl => $ora_install_inventory_loc_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 ora_install facts
#
$ora_install_facts = [
'ora_install_homes.product_version',
'ora_install_homes.opatch_version',
'ora_install_homes.installed_patches',
'ora_install_homes.defined_sids',
'ora_install_homes.running_processes',
'ora_install_inventory_loc',
]
fact_config { $ora_install_facts:
ttl => absent,
}
}
}
}
|