Puppet Function: wls_install::bam_cluster_configured
- Defined in:
- lib/puppet/functions/wls_install/bam_cluster_configured.rb
- Function type:
- Ruby 4.x API
Overview
This function checks if bam cluster is configured in the specified path.
See the file “LICENSE” for the full license governing this code.
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 34 |
# File 'lib/puppet/functions/wls_install/bam_cluster_configured.rb', line 9 Puppet::Functions.create_function(:'wls_install::bam_cluster_configured') do dispatch :bam_cluster_configured do param 'String', :domain_dir param 'String', :bam_cluster_name return_type 'Boolean' end def bam_cluster_configured(domain_dir, bam_cluster_name) scope = closure_scope fact = scope['wls_install_domains'] if fact.keys.empty? call_function('wls_install::log', 'bam_cluster_configured no domains found, return false') return false else fact.each_key do |domain| bam = fact[domain]['bam'] if bam&.include?(bam_cluster_name) && (fact[domain]['path'] == domain_dir) call_function('wls_install::log', "bam_cluster_configured cluster found in '#{bam}' in path '#{domain_dir}', return true") return true end end end call_function('wls_install::log', "bam_cluster_configured no clusters found named '#{bam_cluster_name}' with path '#{domain_dir}', return false") false end end |