Puppet Function: ora_config::is_pluggable_db
- Defined in:
- lib/puppet/functions/ora_config/is_pluggable_db.rb
- Function type:
- Ruby 4.x API
Overview
See the file “LICENSE” for the full license governing this code.
Function to fetch the fact ora_is_pluggable_db and based on that information decide if the specified sid is a pluggable database or not.
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/puppet/functions/ora_config/is_pluggable_db.rb', line 10 Puppet::Functions.create_function('ora_config::is_pluggable_db') do dispatch :is_pluggable_db do param 'String', :sid # return_type 'Boolean' TODO: Wait until the Puppet version supporting this, is mainstream end def is_pluggable_db(sid) variable = 'ora_is_pluggable_db' if variable_exists?(variable) fact_value = closure_scope.lookupvar("::#{variable}") fact_value ? call_function('ora_config::on_sid', fact_value, sid) == ['TRUE'] : false else # # This is probably oracle 11. So assume it is not a pluggable db # false end end # Check if the variable exists without generating a warning def variable_exists?(var) closure_scope.to_hash.key?(var) end end |