Puppet Function: wls_install::domain_exists

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

Overview

wls_install::domain_exists(String $domain_dir)Boolean

This function checks if domain exists in the specified location.

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

Parameters:

  • domain_dir (String)

Returns:

  • (Boolean)


9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/puppet/functions/wls_install/domain_exists.rb', line 9

Puppet::Functions.create_function(:'wls_install::domain_exists') do
  dispatch :domain_exists do
    param 'String', :domain_dir
    return_type 'Boolean'
  end

  def domain_exists(domain_dir)
    scope = closure_scope
    fact = scope['wls_install_domains']
    if fact.keys.empty?
      call_function('wls_install::log', 'domain_exists no domains found, return false')
      return false
    else
      fact.each_key do |domain|
        domain_path = fact[domain]['path']
        if domain_path == domain_dir
          call_function('wls_install::log', "domain_exists domain found '#{domain_path}' is '#{domain_dir}', return true")
          return true
        end
      end
    end
    call_function('wls_install::log', 'domain_exists domain not found, return false')
    false
  end
end