Puppet Function: ora_install::opatch_version

Defined in:
lib/puppet/functions/ora_install/opatch_version.rb
Function type:
Ruby 4.x API

Overview

ora_install::opatch_version(String $oracle_home)String

See the file “LICENSE” for the full license governing this code.

Returns the the installed Opatch version for a specfied Oracle home

Parameters:

  • oracle_home (String)

Returns:

  • (String)


6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/puppet/functions/ora_install/opatch_version.rb', line 6

Puppet::Functions.create_function(:'ora_install::opatch_version') do
  dispatch :opatch_version do
    param 'String', :oracle_home
    return_type 'String'
  end

  def opatch_version(oracle_home)
    scope = closure_scope
    fact = scope['ora_install_homes']
    if fact && fact['opatch_version'][oracle_home]
      if fact['opatch_version'][oracle_home] == 'Invalid'
        fail "Either ORACLE_HOME '#{oracle_home}' or '#{oracle_home}/OPatch/opatch' not found. Faulty oraInventory entry? Please fix!"
      else
        fact['opatch_version'][oracle_home]
      end
    else
      ''
    end
  end
end