Puppet Function: wls_install::fmw_installed

Defined in:
lib/puppet/functions/wls_install/fmw_installed.rb
Function type:
Ruby 4.x API

Overview

wls_install::fmw_installed(Stdlib::Absolutepath $oracle_home, Wls_install::Fmw_products $product)Boolean

Check if the Fusion Middleware product is already installed

Parameters:

  • oracle_home (Stdlib::Absolutepath)
  • product (Wls_install::Fmw_products)

Returns:

  • (Boolean)


11
12
13
14
15
16
17
18
19
20
21
22
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
# File 'lib/puppet/functions/wls_install/fmw_installed.rb', line 11

Puppet::Functions.create_function(:'wls_install::fmw_installed') do
  dispatch :fmw_installed do
    param 'Stdlib::Absolutepath',      :oracle_home
    param 'Wls_install::Fmw_products', :product
    return_type 'Boolean'
  end

  #
  # TODO: At this point in time only the feature for forms has been verified.
  # We need to verify all other features too.
  #

  def feature_for_fmw_product(product)
    features = {
      'forms' => 'forms_deployment',
      'adf' => /adf/,
      'soa' => /soa/,
      'soaqs' => /soaqs/,
      'osb' => /osb/,
      'wcc' => /wcc/,
      'wc' => /wc/,
      'oim' => /oim/,
      'oam' => /oam/,
      'web' => /ohs/,
      'webgate' => /webgate/,
      'oud' => /oud/,
      'mft' => /mft/,
      'b2b' => /b2b/,
      'bip' => /bi/
    }.freeze
    features[product]
  end

  def fmw_installed(home, product)
    #
    # The specified home is located under a regular home. We need to
    # inspect the regular home so we get the parent dir
    #
    call_function('wls_install::log', "Checking if #{home} contains FMW product #{product}.")
    scope = closure_scope
    fact = scope['wls_install_homes']
    fail 'fact wls_install_homes should be a Hash' if fact.class != Hash
    return false if fact.empty? # No homes yet
    return false unless fact['installed_features'].key?(home) # Requested home not yet
    return false if fact['installed_features'][home].grep(feature_for_fmw_product(product)).empty?

    call_function('wls_install::log', "#{home} has been confirmed to contain FMW product #{product}.")
    true
  end
end