Sha256: 56429f017831b300e95dd84526490a02f7202e855153962f5391535cadf97024

Contents?: true

Size: 1.14 KB

Versions: 18

Compression:

Stored size: 1.14 KB

Contents

require 'puppet/indirector/terminus'

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

  def find(request)
    node         = CORL::Provisioner::Puppetnode.node
        
    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
    node.lookup(request.key, nil, config)
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
corl-0.5.17 lib/puppet/indirector/corl.rb
corl-0.5.16 lib/puppet/indirector/corl.rb
corl-0.5.15 lib/puppet/indirector/corl.rb
corl-0.5.14 lib/puppet/indirector/corl.rb
corl-0.5.13 lib/puppet/indirector/corl.rb
corl-0.5.12 lib/puppet/indirector/corl.rb
corl-0.5.11 lib/puppet/indirector/corl.rb
corl-0.5.10 lib/puppet/indirector/corl.rb
corl-0.5.9 lib/puppet/indirector/corl.rb
corl-0.5.8 lib/puppet/indirector/corl.rb
corl-0.5.7 lib/puppet/indirector/corl.rb
corl-0.5.6 lib/puppet/indirector/corl.rb
corl-0.5.5 lib/puppet/indirector/corl.rb
corl-0.5.4 lib/puppet/indirector/corl.rb
corl-0.5.3 lib/puppet/indirector/corl.rb
corl-0.5.2 lib/puppet/indirector/corl.rb
corl-0.5.1 lib/puppet/indirector/corl.rb
corl-0.5.0 lib/puppet/indirector/corl.rb