Sha256: cfa18a4c37e2421f407c95b544a14453545cbc8c0ffe99d35a76cec2a2c49b83

Contents?: true

Size: 1.07 KB

Versions: 26

Compression:

Stored size: 1.07 KB

Contents

require 'puppet/indirector/terminus'

class Puppet::Indirector::Corl < Puppet::Indirector::Terminus
  
  def initialize(*args)
    unless CORL::Config.config_initialized?
      raise "CORL terminus not supported without the CORL library"
    end
    super
  end
  
  #---

  def find(request)
    puppet_scope = request.options[:variables]    
    module_name  = nil
    module_name  = puppet_scope.source.module_name if puppet_scope.source
    contexts     = [ :param, :data_binding, request.key ]
    
    default_options = {
      :provisioner     => :puppetnode,
      :hiera_scope     => puppet_scope,
      :puppet_scope    => puppet_scope,
      :search          => 'core::default',
      :search_name     => false,
      :force           => true,
      :merge           => true,
      :undefined_value => :undef
    }
    
    if module_name
      config = CORL::Config.init({}, contexts, module_name, default_options)  
    else
      config = CORL::Config.init_flat({}, contexts, default_options)
    end
          
    value = CORL::Config.lookup(request.key, nil, config)
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
corl-0.4.29 lib/puppet/indirector/corl.rb
corl-0.4.28 lib/puppet/indirector/corl.rb
corl-0.4.27 lib/puppet/indirector/corl.rb
corl-0.4.26 lib/puppet/indirector/corl.rb
corl-0.4.25 lib/puppet/indirector/corl.rb
corl-0.4.24 lib/puppet/indirector/corl.rb
corl-0.4.23 lib/puppet/indirector/corl.rb
corl-0.4.22 lib/puppet/indirector/corl.rb
corl-0.4.21 lib/puppet/indirector/corl.rb
corl-0.4.20 lib/puppet/indirector/corl.rb
corl-0.4.19 lib/puppet/indirector/corl.rb
corl-0.4.18 lib/puppet/indirector/corl.rb
corl-0.4.17 lib/puppet/indirector/corl.rb
corl-0.4.16 lib/puppet/indirector/corl.rb
corl-0.4.15 lib/puppet/indirector/corl.rb
corl-0.4.14 lib/puppet/indirector/corl.rb
corl-0.4.13 lib/puppet/indirector/corl.rb
corl-0.4.12 lib/puppet/indirector/corl.rb
corl-0.4.11 lib/puppet/indirector/corl.rb
corl-0.4.10 lib/puppet/indirector/corl.rb