Class: Puppet::Indirector::Corl
- Inherits:
-
Terminus
- Object
- Terminus
- Puppet::Indirector::Corl
- Defined in:
- lib/puppet/indirector/corl.rb
Direct Known Subclasses
Instance Method Summary collapse
-
#find(request) ⇒ Object
—.
-
#initialize(*args) ⇒ Corl
constructor
A new instance of Corl.
Constructor Details
#initialize(*args) ⇒ Corl
Returns a new instance of Corl.
6 7 8 9 10 11 12 13 |
# File 'lib/puppet/indirector/corl.rb', line 6 def initialize(*args) node = CORL::Provisioner::Puppetnode.node unless node.config_initialized? raise "CORL terminus not supported without the CORL library" end super end |
Instance Method Details
#find(request) ⇒ Object
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 |
# File 'lib/puppet/indirector/corl.rb', line 17 def find(request) node = CORL::Provisioner::Puppetnode.node puppet_scope = request.[:variables] module_name = nil module_name = puppet_scope.source.module_name if puppet_scope.source contexts = [ :param, :data_binding, request.key ] = { :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, ) else config = CORL::Config.init_flat({}, contexts, ) end node.lookup(request.key, nil, config) end |